Resolving a configuration when project dependencies are involved, does not work
as I expect. I don't know if this is by design or the result of a bug. Here
is a simple example:
Project A -> Project B -> Project C.
Excerpt from dependencies report on project A:
runtime - Classpath for running the compiled sources.
|-----gprob:b:1.0:default
|-----gprob:c:1.0:default
| |-----jdom:jdom:1.1:default
| | |-----org.jdom:jdom:1.1:master,runtime,compile,default
|-----commons-io:commons-io:1.1:default
|-----commons-util:commons-util:final:default
I want to determine the set of all external dependencies for project A
(including transitive project dependencies).
In project A, configurations.runtime.resolve() results in:
/Users/sappling/temp/gprob/b/build/libs/b-1.0.jar,
/Users/sappling/temp/gprob/c/build/libs/c-1.0.jar,
/Users/sappling/.gradle/cache/org.jdom/jdom/jars/jdom-1.1.jar,
/Users/sappling/.gradle/cache/commons-io/commons-io/jars/commons-io-1.1.jar,
/Users/sappling/.gradle/cache/commons-util/commons-util/jars/commons-util-final.jar
This is what I expect. It is the default archives for projects b and c and all
the external dependencies for all 3 projects.
Trying to get only the external dependencies, I tried:
configurations.runtime.copyRecursive(DependencySpecs.type(Type.EXTERNAL)).resolve()
This results in only the single external dependency in project A:
/Users/sappling/.gradle/cache/commons-util/commons-util/jars/commons-util-final.jar
This is not what I expected, but I don't know if this is by design. It seems
inconsistent that project dependencies are resolved transitively for an
unfiltered configuration, but not for a copied configuration with a filter.
Similarly configurations.runtime.allDependencies only gets the dependencies
directly declared in project A. Due to the behavior of resolve, one might
expect getAllDependencies to include transitive project dependencies as well.
Transitive project dependencies need to be explicitly addressed in the
Configuration class, both in the documentation and in the API.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email