Closed ethauvin closed 7 years ago
Working as expected. I resolved this dependency with Maven Resolver's own example and it produced the same result:
org.apache.velocity:velocity:jar:1.7 resolved to /Users/cedricbeust/java/maven-resolver/target/local-repo/org/apache/velocity/velocity/1.7/velocity-1.7.jar
commons-collections:commons-collections:jar:3.2.1 resolved to /Users/cedricbeust/java/maven-resolver/target/local-repo/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
commons-lang:commons-lang:jar:2.4 resolved to /Users/cedricbeust/java/maven-resolver/target/local-repo/commons-lang/commons-lang/2.4/commons-lang-2.4.jar
oro:oro:jar:2.0.8 resolved to /Users/cedricbeust/java/maven-resolver/target/local-repo/oro/oro/2.0.8/oro-2.0.8.jar
Assuming:
which resolves to:
collect(compileDependencies)
will returnvelocity
,commons-collections
andcommons-lang
as expected.Change to:
collect(compileDependencies)
will still return all three dependencies, not justvelocity
. I think that's a caching issue.Additionally, I'm using an annotator, which requires both
apt(annotatorJar)
andcompile(annotatorJar)
, like most do.The problem is when I'm using
collect(compileDependencies)
, I'm getting the annotator jar and it's dependencies, but I don't really need them to be deployed to theinstall
target.Gradle addresses that issue by providing a
compileOnly 'annotatorJar'
directive. Meaning that when collecting the compile dependencies, no annotator dependencies will be included.