出现该类问题是只找到了接口未找到映射文件;
解决办法一:
将映射文件存放在resources下,要求包名与接口的包名一致;
解决方法二:
在接口所在的module中的pom.xml文件下添加依赖
<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 --> <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>
原文地址:https://www.cnblogs.com/zandz/p/8654184.html
时间: 2024-11-15 06:12:13