Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource xxx

今天在使用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>
发布了241 篇原创文章 · 获赞 94 · 访问量 13万+

猜你喜欢

转载自blog.csdn.net/weixin_41060905/article/details/103314244
今日推荐