1.配置数据源问题 application.yml可不可以什么都不写?
不配置数据源可能会报错 可能需要 @SpringBootApplication(exclude ={ DataSourceAutoConfiguration.class})
但是有时候不exclude也不报错? 不懂为什么

2.用到shardingsphere时候,仅仅在maven中引用,没在任何地方调用就会报错(缺少shardingsphere的数据源配置)。
第一次遇见 是因为自动配置吗?

1
2
3
4
5
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
<version>4.1.1</version>
</dependency>