[英]Why Gradle 5 (5.6.3) made an unexpected decision during component resolution?
我有一个非常大的多项目 java 构建。 在 Gradle 5(4.10.3->5.6.3) 更新之后,最可怕的事情之一就是依赖解析过程中的意外失败:
...
dependencies {
// I know about the deprecation of 'compile', with 'implementation' I have the same problems
compile project(":Monitor")
compile project(":WFPlugins-Server")
compile project(":web-spring")
compile project(":Security")
compile project(":Client")
}
...
对我来说很清楚,它应该是一个项目依赖。 但我收到:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':SpringWFS:compileJava'.
> Could not resolve all files for configuration ':SpringWFS:compileClasspath'.
> Could not find com.company:WFPlugins-Server:1.12.
Required by:
project :SpringWFS
因此,gradle 试图将其解决为ExternalModuleDependency [在 gradle 方面] 而不是DefaultProjectDependency并且构建按预期失败
有人解决这个问题吗?
评论:
Gradle 将项目依赖替换为模块依赖的唯一原因是:
WFPlugins-Server
作为二进制依赖项,并且它作为SpringWFS
依赖项图的一部分出现,并且它的版本高于项目。在最后一种情况下,您可以调整解析策略以更喜欢 project 而非 modules 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.