I was wondering if there was anyway to exclude specific files,that are inside a dependency (not a transitive dependency), from being downloaded.
I am switching a build from Ant + Ivy to Gradle and this was done with in Ivy before. I ask because I have a single dependency that contains many compiled wsdl jars in Artifactory that we are pulling down, but I do not want to download all of the jars in the dependency.
In Ivy it was setup like:
These 6 artifacts are published to Artifactory in to one directory repo/dep.location/example/7.3/jar.
<publications>
<artifact name="foo-1-0" type="jar" />
<artifact name="foo-1-0-async" type="jar" />
<artifact name="foo-1-0-xml" type="jar" />
<artifact name="bar-1-0" type="jar" />
<artifact name="bar-1-0-async" type="jar" />
<artifact name="bar-1-0-xml" type="jar" />
</publications>
This is how I retrieve only two of the six artifacts.
<dependency org="dep.location" name="example" rev="7.3"
conf="compile,runtime">
<include name="foo-1-0-async"/>
<include name="foo-1-0-xml"/>
</dependency>
Currently if I attempt to do something similar in Gradle the excludes are ignored and all six artifacts are downloaded.
compile (group:"dep.location", name:"example", version:"7.3")
{
exclude module:'foo-1-0-xml'
exclude module:'bar-1-0'
exclude module:'bar-1-0-async'
exclude module:'bar-1-0-xml'
}
I am using Gradle version 1.8.