方式一:
dependencies {
/**
* 单个依赖项禁用传递依赖
*/
compile("org.springframework:spring-core:4.3.28.RELEASE") {
transitive = false
}
}
方式二:
/**
* 全局配置
*/
configurations.all {
//禁用Gradle中的所有传递依赖项
transitive = false
}
望此文能够帮助到您!