[GRADLE-1277] EclipsePlugin does not always resolve correct version of dependencies Created: 29/Dec/10  Updated: 04/Jan/13  Resolved: 16/Mar/12

Status: Resolved
Project: Gradle
Affects Version/s: 0.9
Fix Version/s: None

Type: Bug
Reporter: Matt Accola Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 2

Attachments: Zip Archive test.zip    

 Description   

When a multi-module project declares a dependency on more than one version of a given dependency the normal Gradle dependency resolution figures this out and correctly selects the highest version of the dependency. However, the EclipsePlugin does not figure this out and may include the older version in some cases.

The use case may sound strange but it could actually be quite common. A sample project demonstrating a valid use case and the Gradle bug is attached. In the sample project TestModuleB depends on 'commons-lang:commons-lang:2.5'. TestModuleA depends on 'TestModuleB' and also 'org.apache.velocity:velocity:1.7'. Apache Velocity depends on a different version of commons-lang (commons-lang:commons-lang:2.4). TestWeb depends on 'TestModuleB'.

If we run 'gradle dependencies' against TestModuleA we see that it correctly reports a dependency on the 2.5 version of commons-lang. If we generate the war file for TestWeb we see that it correctly bundles commons-lang-2.5.jar.

However, if we run 'gradle eclipse' we see that the .classpath for TestModuleA incorrectly includes a classpathentry for commons-lang-2.4.jar.



 Comments   
Comment by Matt Accola [ 29/Dec/10 ]

Please note there is a mistake in the write-up. The last sentence in paragraph 2 should read "TestWeb depends on 'TestModuleA'."

Comment by Szczepan Faber [ 16/Mar/12 ]

We did a fair number of improvements in eclipse and dependency management area so no wonder I cannot reproduce it with recent versions of Gradle.

If that's ok, I'm closing the issue.

Generated at Wed Jun 30 11:51:27 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.