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.
问题描述如下:
上网找了好几个方法都不好用,最终解决方法如下:
properties配置文件增加spring.main.allow-bean-definition-overriding= true
或yml配置文件如下图: