Results 3 comments of hakil

强迫症,也在看这个问题。 入口应该是在 `tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration` 或`org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration` 如果没有`MapperFactoryBean`实例,则从根路径扫描@Mapper注解类 ![2](https://user-images.githubusercontent.com/13636211/40216887-572f7d0c-5a9c-11e8-9a33-9cc64be37b3c.jpg) ![3](https://user-images.githubusercontent.com/13636211/40217001-03c729d4-5a9d-11e8-9552-d0e6663139ae.jpg) 在`Application`类上已经使用了`tk`的`@MapperScan`注解,启动信息显示没有找到`MapperFactoryBean`实例,但debug发现已经扫描到了Mapper,这就让我很费解了。 ![111](https://user-images.githubusercontent.com/13636211/40217070-58ebd2c0-5a9d-11e8-9225-ed94d92d8402.png) 至于两次`warn`是因为`Pagehelper`依赖`mybatis-spring-boot-starter`

如果集成了`mapper-spring-boot-starter`和`pagehelper-spring-boot-starter` 就屏蔽掉`Mybatis`中的自动配置,减少一次扫描`@Mapper`。 `@SpringBootApplication(exclude = MybatisAutoConfiguration.class)` 剩下的一次`WARN`忽略掉吧,为了兼容`@Mapper`注解,这里做个开关会比较好。