Hard to explain this in the title, so I’ll write an example. First, assume, I have a dependency A that depends on B and I declare this dependency in my build:
dependencies {
compile 'a:a:1.0'
}
I can get the files for this dependency by doing this:
I expect to get ‘a-1.0.jar’ but NOT ‘b-1.0.jar’. Instead I get nothing back. I believe it’s because it’s matching the dependency that I’ve created against what was resolved in the configuration. Since the dependency I’ve created is different (transitive=false, instead of true in the original declaration), than it doesn’t match and no files are returned.
Is there anyway to do this type of query against a resolved configuration?
My use case is that I’m reimplementing my Shadow plugin to be based on Gradle’s Jar task and then using a custom CopyTaskAction underneath. One of the features of Shadow (from Maven’s Shade) is that you can exclude dependencies from the shaded jar using their Maven coordinates (and additionally apply filtering rules to specific jars using Maven coordinates). So I’m trying to replicate that feature in the most Gradle way possible.