IDEA中,如果你把xml文件放在java目录下,编译和打包时是不会打包进WEB-INF/classes下的,需要在pom文件中配置:
<build>
<!--打包时包含源代码包下的资源文件-->
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>