I have a configuration with resolutionStrategy.failOnVersionConflict()
and transitive = true
and now I add two components:
component1
depends onlib
version 1.0component2
depends onlib
version 1.1
As expected, resolving this configuration fails:
Could not resolve all dependencies for configuration ‘:compile’.
A conflict was found between the following modules:
- com.example:lib:1.0
- com.example:lib:1.1
My problem is: Where do these conflicts come from? This example is extremely obvious, but considering more dependencies with multiple levels of transitive dependencies, it is next to impossible to figure out the root cause for conflicts.
Unfortunately dependencyInsight
does not work, because it also tries to resolve the exception, which, of course, fails.
What can I do now?
It would be helpful instead to get a path from the direct dependencies to those transitive ones that conflict in the exception message, e.g.
Could not resolve all dependencies for configuration ‘:compile’.
A conflict was found between the following modules:
- com.example:component1:1 → com.example:lib:1.0
- com.example:component2:1 → com.example:lib:1.1