1.确保项目结构的正确
- 确保资源导入成功
如果没有成功,在 pom.xml
中添加如下代码,防止资源导出失败的问题。添加以后,任然未成功,清除maven, 重启idea,再次尝试。
<!--在build中配置resources,来防止我们资源导出失败的问题-->
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>