如果存在冲突的依赖版本,我使用Gradle resolutionStrategy
来失败构建:
configurations.all {
resolutionStrategy {
failOnVersionConflict()
}
}
在冲突的情况下,我收到以下消息:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':module:testCompileClasspath'.
> A conflict was found between the following modules:
- com.netflix.archaius:archaius-core:0.6.6
- com.netflix.archaius:archaius-core:0.4.1
如何让Gradle显示这些工件的依赖路径?
现在我必须从build.gradle
中删除failOnVersionConflict()
,以便能够运行dependencies
任务,然后搜索冲突工件的发生。你可能猜到了,一次又一次地重复这些步骤是非常烦人的。
你应该能看到一条消息,上面写着:
Run with:
--scan or
:dependencyInsight --configuration _classStructurekaptKotlin --dependency org.apiguardian:apiguardian-api