问题描述:
我们写的配置文件一般多在resources,但有时为了方便管理,不止在resources中写入配置文件,也可能在src文件里面进行配置文件的置入,而当我们将配置文件写入到src文件时则无法导出到target,而导致程序发生错误
解决方法:在pox里面加入:
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>