Issue Details (XML | Word | Printable)

Key: GRADLE-816
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Hans Dockter
Reporter: Felix Gnass
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Gradle

3rd-level transitive runtime dependencies are no longer resolved

Created: 09/Feb/10 03:09 AM   Updated: 12/Feb/10 05:45 AM
Component/s: dependencies
Affects Version/s: 0.9
Fix Version/s: 0.9

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive gradle-deps-bug.zip (4 kB)
2. Zip Archive gradle-test.zip (6 kB)

Environment: Gradle 0.9-20100208163629+0100

Testcase included: yes


 Description  « Hide

Gradel's behavior has changed from 0.8 to 0.9 when it comes to the resolution of runtime dependencies. I've attached a ZIP-file containing a simple example.

The test-case consists of two projects called "project" and "framework". The latter one is a multi-project build with dependencies between its modules:

framework/libA/build.gradle
dependencies { compile project(':libB') }

framework/libB/build.gradle
dependencies { runtime project(':libC') }

The other project has a module-dependency to libA:

project/build.gradle
dependencies { compile 'eg.example:libA:1.0.0-SNAPSHOT' }

With Gradle 0.8 everthing works as expected and running `gradle war` in ./project creates a WAR-file containing all three JARs (libA, libB and libC).

With Gradle 0.9-20100208163629+0100, only libA and libB are present, whereas libC is missing.

This is the command output of the different versions. The difference id that in 8.0 libB is requested with conf=master,compile,runtime, whereas in 9.0 only the compile configuration is requested:

$ gradle -v

------------------------------------------------------------
Gradle 0.8
------------------------------------------------------------

Gradle buildtime: Monday, September 28, 2009 2:01:59 PM CEST
Groovy: 1.6.4
Ant: Apache Ant version 1.7.0 compiled on December 13 2006
Ivy: 2.1.0-rc2
Java: 1.6.0_17
JVM: 14.3-b01-101
JVM Vendor: Apple Inc.
OS Name: Mac OS X

$ gradle --dependencies
:reportTask

------------------------------------------------------------
Root Project
------------------------------------------------------------
archives - Configuration for the default artifacts.
compile - Classpath for compiling the sources.

-----eg.example:libA:1.0.0-SNAPSHOT:default
default - Configuration the default artifacts and its dependencies.
-----eg.example:libA:1.0.0-SNAPSHOT:default
-----eg.example:libB:1.0.0-SNAPSHOT:master,compile,runtime
  -----eg.example:libC:1.0.0-SNAPSHOT:master,compile,runtime
runtime - Classpath for running the compiled sources.
-----eg.example:libA:1.0.0-SNAPSHOT:default
-----eg.example:libB:1.0.0-SNAPSHOT:master,compile,runtime
  -----eg.example:libC:1.0.0-SNAPSHOT:master,compile,runtime
testCompile - Classpath for compiling the test sources.
-----eg.example:libA:1.0.0-SNAPSHOT:default
testRuntime - Classpath for running the test sources.
-----eg.example:libA:1.0.0-SNAPSHOT:default
-----eg.example:libB:1.0.0-SNAPSHOT:master,compile,runtime
  -----eg.example:libC:1.0.0-SNAPSHOT:master,compile,runtime

BUILD SUCCESSFUL

$ gradle -v

------------------------------------------------------------
Gradle 0.9-20100208163629+0100
------------------------------------------------------------

Gradle buildtime: Montag, 8. Februar 2010 16:36 Uhr MEZ
Groovy: 1.7.0
Ant: Apache Ant version 1.7.0 compiled on December 13 2006
Ivy: 2.1.0
Java: 1.6.0_17
JVM: 14.3-b01-101
JVM Vendor: Apple Inc.
OS Name: Mac OS X

$ gradle --dependencies
The Project.usePlugin() method is deprecated and will be removed in the next version of Gradle. You should use the apply() method instead.
:report

------------------------------------------------------------
Root Project
------------------------------------------------------------
archives - Configuration for the default artifacts.
compile - Classpath for compiling the sources.
downloading (790 B) file:/Users/flx/.m2/repository/eg/example/libA/1.0.0-SNAPSHOT/libA-1.0.0-SNAPSHOT.pom
..

-----eg.example:libA:1.0.0-SNAPSHOT:default
default - Configuration the default artifacts and its dependencies.
downloading (790 B) file:/Users/flx/.m2/repository/eg/example/libB/1.0.0-SNAPSHOT/libB-1.0.0-SNAPSHOT.pom
..
downloading (579 B) file:/Users/flx/.m2/repository/eg/example/libC/1.0.0-SNAPSHOT/libC-1.0.0-SNAPSHOT.pom
..
-----eg.example:libA:1.0.0-SNAPSHOT:default
-----eg.example:libB:1.0.0-SNAPSHOT:compile
runtime - Classpath for running the compiled sources.
-----eg.example:libA:1.0.0-SNAPSHOT:default
-----eg.example:libB:1.0.0-SNAPSHOT:compile
testCompile - Classpath for compiling the test sources.
-----eg.example:libA:1.0.0-SNAPSHOT:default
testRuntime - Classpath for running the test sources.
-----eg.example:libA:1.0.0-SNAPSHOT:default
-----eg.example:libB:1.0.0-SNAPSHOT:compile

BUILD SUCCESSFUL



Peter Ledbrook added a comment - 09/Feb/10 03:24 AM

I think the project in gradle-deps-bug.zip is exhibiting the same problem, but I'm not sure. If you extract it and run gradle -i assemble, you will see that spring-webmvc is resolved by Ivy, but Gradle does not include it in the runtime configuration's files collection.