问题描述
在SpringBoot项目启动之后,MyBatisPlus爆出警告信息:Skipping MapperFactoryBean with name 'sysConfigMapper' and 'com.xxx.*.mapper.xxxMapper' mapperInterface. Bean already defined with the same name!
问题缘由
注意到最后一句提示信息: Bean already defined with the same name!,盲猜可能是Mapper接口被重复扫描,导致注册了两次,第二次就爆出了警告。
解决方案
在进行MyBatis-Plus分页配置时,重复使用了@MapperScan注解,
在启动类上也使用了 @MapperScan注解,
从中任意删除一个,警告信息不再出现。