[GRADLE-816] 3rd-level transitive runtime dependencies are no longer resolved Created: 09/Feb/10  Updated: 04/Jan/13  Resolved: 24/Nov/10

Status: Resolved
Project: Gradle
Affects Version/s: 0.9
Fix Version/s: 0.9-rc-1

Type: Bug
Reporter: Felix Gnass Assignee: Hans Dockter
Resolution: Fixed Votes: 1

Attachments: Zip Archive gradle-deps-bug.zip     Zip Archive gradle-test.zip    

 Description   

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



 Comments   
Comment by Peter Ledbrook [ 09/Feb/10 ]

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.

Comment by Hans Dockter [ 19/Apr/10 ]

This issue is fixed. Thanks a lot for the test cases.

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