Dependency conflict display origins


(Thibault Kruse) #1

Hi, using gradle 1.5 I get dependency conflict errors that do not show where those come from. e.g. Execution failed for task ‘:dependencies’. > Could not resolve all dependencies for configuration ‘:compile’.

A conflict was found between the following modules:

  • org.apache.httpcomponents:httpclient:4.0

  • org.apache.httpcomponents:httpclient:4.0.3

The gradle 1.2 release notes say this had been improvedback than. has this regressed, or how else can I see easily where this conflict comes from? I know I can resolve it and then grep through the tree to see, but that’s not very comfortable


(Peter Niederwieser) #2

Try ‘gradle dependencyInsight --dependency httpclient’.


(Thibault Kruse) #3

That works, but it is not terribly comfortable


(Thibault Kruse) #4

However, I have no clue how to invoke for this conflict:

Could not resolve all dependencies for configuration ‘:rhino’.

A conflict was found between the following modules:

  • org.mozilla:rhino:1.7R4

  • org.mozilla:rhino:1.7R3

This one is not correct:

gradle dependencyInsight --dependency rhino > :dependencyInsight > rhino:js:1.7R2 > — compile

and all other combinations I tried failed. i don’t think it is a compile configuration conflict, but I have no idea what configuration the dependency belongs to. So this does not help there neither.


(Peter Niederwieser) #5

By default, ‘dependencyInsight’ searches the ‘compile’ configuration. See the Gradle User Guide for details.


(Thibault Kruse) #6

Yes, I can see that, but it does not helpme in this case to find the right configuration to use. I tried --configuration rhino, but that did not help.

To reproduce, use apply plugin js and apply plugin css


(Peter Niederwieser) #7

‘rhino’ should be the correct configuration. After all it says ‘Could not resolve all dependencies for configuration ‘:rhino’’.


(Thibault Kruse) #8

I tried that, too, though the ‘:’ prefix is a bit confusing too. But then I get this:

gradle dependencyInsight --dependency rhino --configuration rhino :dependencyInsight FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:dependencyInsight’. > Could not resolve all dependencies for configuration ‘:rhino’.

A conflict was found between the following modules:

  • org.mozilla:rhino:1.7R4

  • org.mozilla:rhino:1.7R3


(Paulo Bittencourt) #9

I had a similar issue.

I have

failOnVersionConflict()

enabled under ‘all’ configurations. When I tried to run dependencyInsight, I got an error similar to yours.

By temporarily commenting out failOnVersionConflict(), I was able to run dependencyInsight and see the modules involved.

It seems like failOnVersionConflict() was causing the task sequence to fail before dependencyInsight could run. It would be nice of the version conflict code could just provide the offending modules.