[GRADLE-1005] Dependency resolving fails for certain maven artifacts Created: 23/Jun/10 Updated: 04/Jan/13 Resolved: 21/Aug/11 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | 1.0-milestone-4 |
Type: | Bug | ||
Reporter: | Zsolt Kúti | Assignee: | Luke Daley |
Resolution: | Fixed | Votes: | 0 |
Description |
When I try to use a dependency the following error appears: :::: ERRORS FAILURE: Build failed with an exception.
A bare-bone script that shows this: repositories { dependencies { Although there is an Ivy issue which seems to have the same root: |
Comments |
Comment by Hans Dockter [ 25/Jun/10 ] |
The failing dependency has the following pom: <project> <modelVersion>4.0.0</modelVersion> <groupId>net.jini</groupId> <artifactId>jsk-platform</artifactId> <name>Jini Starter Kit Platform Jar</name> <version>2.1</version> <inceptionYear>2005</inceptionYear> <organization /> <build /> <dependencies> <dependency> <groupId>net.jini</groupId> <artifactId>jsk-platform</artifactId> <version>2.1</version> </dependency> </dependencies> </project> You could argue that such a pom does not make any sense. On the other hand Maven resolves is without throwing an exception. If you look at the Maven resolve debug output you find the following: [INFO] skip non existing resourceDirectory /Users/hans/tmp/maven/recu/src/main/resources [DEBUG] gradle:recu:jar:1.0-SNAPSHOT (selected for null) [DEBUG] junit:junit:jar:3.8.1:test (selected for test) [DEBUG] net.jini:jsk-platform:jar:2.1:compile (selected for compile) [DEBUG] net.jini:jsk-platform:jar:2.1:compile (removed - causes a cycle in the graph) [DEBUG] Plugin dependencies for: The problem is that Ivy's approach for Maven compatibility is reverse engineering Maven's behavior. Whether the above pom makes sense or not is a mute point. We need to provide the same behavior as Maven. To achieve that we will use a native Maven resolver in Gradle 1.0, where we use embedded Maven to let Maven do the job without the need for reverse engineering it's behavior. |
Comment by Zsolt Kúti [ 25/Jun/10 ] |
So my short term options to get around this are:
Thanks for looking into it! |
Comment by Hans Dockter [ 25/Jun/10 ] |
Right. The Ivy solution is probably not short term. What we are planning for 1.0 is to provide an Ivy resolver that uses native maven code for resolving pom's. The default Ivy Maven resolver parses the pom itself and tries to interpret it. That way you are bound to run into corner cases. |
Comment by Pivotal Tracker Integration [ 04/Aug/11 ] |
A Pivotal Tracker story has been created for this Issue: http://www.pivotaltracker.com/story/show/16643573 |
Comment by Pivotal Tracker Integration [ 04/Aug/11 ] |
Daz DeBoer deleted the linked story in Pivotal Tracker |
Comment by Luke Daley [ 21/Aug/11 ] |
This has been fixed by the new dependency resolver implementation. This invalid dependency relationship is silently ignored, just like Maven. |