Mybatis-Plus和maven加載機制
項目中創(chuàng)建mapper接口吕朵,編寫xml文件sql語句,執(zhí)行出現(xiàn)錯誤
ibatis.binding.BindingException:Invalid bound statement (not found)
這個錯誤是由 maven默認加載機制造成的挪哄,maven加載的時候,把java文件里面.java類型文件進行編譯挟冠,其他類型的文件携添,不會加載
解決方式
-
pom.xml
<build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> </resources> </build>
-
application.properties
# 配置mapper xml文件的路徑 mybatis-plus.mapper-locations=classpath:com/xujc/eduservice/mapper/xml/*.xml