由于src-main-java里面的文件默认只加载.java类型的文件,如果需要将xml文件或者其他文件放到java文件夹中
需要在pom文件中进行配置
1 <resources> 2 <resource> 3 <directory>src/main/java</directory> 4 <includes> 5 <include>**/*.yml</include> 6 <include>**/*.properties</include> 7 <include>**/*.xml</include> 8 </includes> 9 <filtering>false</filtering> 10 </resource> 11 <resource> 12 <directory>src/main/resources</directory> 13 <includes> 14 <include>**/*.yml</include> 15 <include>**/*.properties</include> 16 <include>**/*.xml</include> 17 <include>**/*.png</include> 18 </includes> 19 <filtering>false</filtering> 20 </resource> 21 </resources>
标签:xml,src,java,配置文件,文件,静态,maven,main From: https://www.cnblogs.com/huoziqi/p/17419173.html