编译工具:IntelliJ IDEA
项目结构:maven
项目框架:SSM
问题:java目录下,mybatis的配置文件(map.xml)无法编译到class文件夹下
问题原因:在idea中,直接把资源文件放在src文件夹下,如果不进行设置,是不能被找到的。
解决方法:
pom文件中给build添加resource配置
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>