//数据库与读写分离 implementation ('io.shardingsphere:sharding-jdbc-spring-boot-starter:3.1.0') { transitive = true //设置成false,sharding-jdbc-spring-boot-starter下所有的依赖传递性就关了 exclude group: "org.slf4j", module: "slf4j-api"//这样设置的Exclude, 只会使用直接补sharding-jdbc-spring-boot-starter依赖的sel4j没有了,如果它子包下的依赖还是存在的 exclude group: "io.shardingsphere", module: "sharding-transaction-core" } // 排除所有子依赖中的support依赖,统一使用主项目中的版本 configurations { all*.exclude group: "org.slf4j" //不管是compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,不管是直接依赖还是间接依赖都会被Exclude implementation.exclude group: "org.slf4j" //也会在四个ClassPath中全部exclude }