我遇到了两个不同的语法变体,以排除gradle中的瞬态依赖。
一个使用名称,另一个使用模块。哪一个是对的?
例如:
名称:
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation group: 'org.springframework', name: 'spring-context', version: '5.3.19'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation('org.springframework.boot:sprin g-boot-starter-web') {
exclude group: 'org.springframework', name: 'spring-context'
}
}或模块:
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation group: 'org.springframework', name: 'spring-context', version: '5.3.19'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation('org.springframework.boot:sprin g-boot-starter-web') {
exclude group: 'org.springframework', module: 'spring-context'
}
}发布于 2022-04-20 05:16:11
当前的文档(7.4.2)显示了module
https://docs.gradle.org/7.4.2/userguide/dependency_downgrade_and_exclude.html
implementation('commons-beanutils:commons-beanutils:1.9.4') {
exclude group: 'commons-collections', module: 'commons-collections'
}name可能是一个遗留的命名。使用当前文档的内容,module。
https://stackoverflow.com/questions/71927942
复制相似问题