在POM 文件加如下配置即可
<build>
<resources>
// 加载不到 java 目录下的文件 配置
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
// 加载不到 resources 目录下的文件 配置
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.yml</include>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
转载请注明原文地址:https://blackberry.8miu.com/read-2403.html