配置多数据源 dynamic-datasource-spring-boot-starter 踩到的坑 (不断更新中)

环境

java version: 1.8

spring boot version:2.1.14.RELEASE

dynamic-datasource-spring-boot-starter version:3.2.0

程序包 com. baomidou dynamic datasource annotation不存在Error:(19,2)java:找不到符号符号类DS

代码没有红线提示,点击也能跳转,就是编译不过。

试过了网上的所有办法,包括

在这里插入图片描述

最终解决办法,更换 idea 版本

博主之前版本是 2020.1

更换成 2020.2 问题解决

Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.

完整信息如下:
在这里插入图片描述
解决办法,在启动类上加上如下配置,使得项目启动不会默认加载数据源,使用时才加载。

@SpringBootApplication(exclude = DruidDataSourceAutoConfigure.class)

终极解决大法

加入这款插件的开发者交流群,请教大神!!!!

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_29064815/article/details/108418281