I have a very large multi-project java build. After the update to the Gradle 5(4.10.3->5.6.3), one of the most terrifying things is unexpected failures during dependency resolution:
...
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")
}
...
For me it's clear as the day, it's should be a project dependency. But I receive:
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
So the gradle is trying to resolve this as an ExternalModuleDependency [in terms of the gradle] instead of DefaultProjectDependency and build is failing as expected
Is someone solves this problem?
remarks:
- Please don't propose composite builds (it isn't possible at this moment of time but I'm working on it)
- Change the build system (We have a really large project) :)
The only reasons Gradle would replace a project dependency with a module dependency are:
WFPlugins-Server
elsewhere in your build as a binary dependency, and it appears as part of theSpringWFS
dependency graph, and it has a higher version than the project.In the last case, you can tweak the resolution strategy to prefer project over modules.