spring boot mybatis没有扫描jar中的Mapper接口
生活随笔
收集整理的這篇文章主要介紹了
spring boot mybatis没有扫描jar中的Mapper接口
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
只需要在spring?boot啟動類上加上注解,并指定jar包中接口文件包路徑即可
如下:
@ComponentScan(basePackages = "com.xx") @MapperScan(basePackages = "com.xx.**.dao") @SpringBootApplication @EnableCaching @EnableDiscoveryClient public class EnterApplication {public static void main(String[] args) {SpringApplication.run(EnterApplication.class,args);} }如此com.xx包下的任意級子目錄下的dao包下的所有接口都會被掃描到,包括jar包中的。
轉(zhuǎn)載于:https://www.cnblogs.com/flying607/p/8507546.html
總結(jié)
以上是生活随笔為你收集整理的spring boot mybatis没有扫描jar中的Mapper接口的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。