出现这个错误主要是因为mapper中的xml为编译,target中是找不到编译文件的。
解决方法:
在pom.xml中加上:
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
然后在springboot配置文件中加上:(用自己xml所在路径)
#配置mapper xml文件的路径
mybatis-plus.mapper-locations=classpath:com/atguigu/eduservice/mapper/xml/*.xml
重启项目即可。target中就可以找到xml编译文件啦