maven工程,通过pom.xml执行时,main/java中配置文件处理方法

maven install项目生成target文件时, 不会把Resource外的xml文件编译进去,此时需要自己把main/java中xml文件导入到target文件中,需要在pom.xml中加入:

 

<build>
<resources>
<resource>
<directory>src/main/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
posted @ 2018-02-02 19:05  wxjhappy  阅读(369)  评论(0编辑  收藏  举报