Gradle reports a version conflict (failOnVersionConflict()), but running ‘gradle dependencies’ only shows one version in the dependency tree. How can that be?
What went wrong: Execution failed for task ‘:foo:dependencies’. > Could not resolve all dependencies for configuration ‘:foo:testCompile’.
A conflict was found between the following modules:
com.google.guava:guava:12.0
com.google.guava:guava:10.0.1
In the example above, there is a version conflict, but gradle dependencies will not show version 10.0.1 anywhere in the tree.
We have quite a few dependencies in our configurations and I do not know how to efficiently track down where these (possibly transitive) dependencies come from.
If the output displayed the full path for the affected dependencies, it would be easy to resolve the problem. Hence, please consider this a feature request / usability issue.
There doesn’t seem to be a good way to determine which version to use other than commenting out the ‘failOnVersionConflict()’ line and debugging dependencies by using ‘dependencyInsight’. Since we’re using groovy you can do something like the following:
configurations.all {
resolutionStrategy {
if (!project.hasProperty('debugDeps')) {
failOnVersionConflict()
}
force ...
}
}
And then when you run into a conflict you can now do: