Dependency conflict display origins

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

Try ‘gradle dependencyInsight --dependency httpclient’.

That works, but it is not terribly comfortable

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.

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

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

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

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

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.

2 Likes