复制一下代码到pom.xml
<!--在build中配置resources,来防止我们资源导出失败的问题--> <build> <resources> <resource> <directory>src/main/java</directory><!--设置java目录下的指定文件也会被导出--> <includes> <include>**/*.properties</include><!--自己指定的文件类型--> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> <!--系统会自动导出resources中的文件,这个一般不写,如果你的resources中资源也不无法导出,可以试一下把这个加上--> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> </resources> </build>标签:xml,src,导出,maven,失败,main,true,properties From: https://www.cnblogs.com/insoon/p/17047708.html