1.报错
***************************
APPLICATION FAILED TO START
***************************
Description:
The bean 'dataSource', defined in BeanDefinition defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class] and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
Process finished with exit code 1
2.原因
springboot(v2.1.4.RELEASE)+springcloud(vFinchley.RELEASE)+mybatis-spring-boot-starter(v2.0.0)不兼容
3.解决方案
a.粗暴方式:给*.yml文件添加
# 当遇到同样名字的时候,是否允许覆盖注册
# 解决springboot和springcloud不兼容
spring:
main:
allow-bean-definition-overriding: true
# 可以解决,但只是不报错,原因所在是不兼容,不推荐
b.修改版本
springboot(v2.2.1.RELEASE)+springcloud(vFinchley.RELEASE)+mybatis-spring-boot-starter(v2.0.0)
springboot(v2.1.4.RELEASE)+springcloud(vGreenwich.RELEASE)+mybatis-spring-boot-starter(v2.0.0)