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>