maven打包配置resource里排除的文件,项目启动时找不到文件

2019-11-15 16:21发布

pom:
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
如果不排除,配置文件直接打包到jar里,项目启动正常。

<excludes>
<exclude>config/*.properties</exclude>
</excludes>
如果排除了properties文件,项目启动失败,找不到配置文件。nested exception is java.io.FileNotFoundException: class path resource [config/datasource.properties] cannot be opened because it does not exist

标签:
1条回答
乱世女痞
2楼-- · 2019-11-15 17:05

你要问的问题是什么?被你排除了,所以找不到,这一点问题没有

查看更多
登录 后发表回答