spring-boot启动警告:No MyBatis mapper was found…

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

spring-boot继承mybatis启动时,警告如下:

2018-09-10 15:00:14.721 WARN  tk.mybatis.spring.mapper.ClassPathMapperScanner --No MyBatis mapper was found in '[com.kevin]' package. Please check your configuration.

spring-boot启动警告:No MyBatis mapper was found…_第1张图片
使用的tk的开源项目进行mybatis集成,百度了很多解决方案,最终看到一位前辈介绍:doScan()会扫描启动类同级目录下的mapper接口,但是合理的目录结果绝对不允许所有的mapper都在启动类目录下,所以在启动类目录下添加了一个伪mapper,如下:

spring-boot启动警告:No MyBatis mapper was found…_第2张图片spring-boot启动警告:No MyBatis mapper was found…_第3张图片
再重新启动服务,就不会出现如上warn信息了……

转载于:https://my.oschina.net/kevin2kelly/blog/2046324

你可能感兴趣的:(spring-boot启动警告:No MyBatis mapper was found…)