今天在使用mybatis中,报错:Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource xxx
,
这个CustomerMapper.xml我放在了src目录下,而idea不会编译src目录下的.xml文件(只会编译resource下的),
所以解决思路就是:将IDEA maven项目中src源代码下的xml等资源文件编译进classes文件夹
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>