mybatis找不到映射配置文件的原因和解决。
target中没有导入***Mapper.xml,由于maven的约定大于配置属性,这里的配置文件无法被导出或生效。
解决方法:在pom.xml文件中添加如下代码块
<build> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> </resources> </build>
本文来自博客园,作者:xiaoyongdata(微信号:xiaoyongdata),转载请注明原文链接:https://www.cnblogs.com/xiaoyongdata/p/16558323.html