In a huge transitive dependency tree, one module brings an artifact that I do not want. I would like to exclude this artifact in this dependant module
In the documentation of the DependencyHandler (http://gradle.org/docs/current/dsl/org.gradle.api.artifacts.dsl.DependencyHandler.html) we found :
exclude module: 'cglib' //by artifact name
But I guess that what is really meant is ‘by module name’, too bad :).
But basically that’s what I’m trying to do, something like that (I’m making this up) :
exclude module: 'foo', artifactName: 'bar'
Meaning, I will get all artifacts of module foo, expect artifact ‘bar’ ( bar.ear, for exemple)
Using ‘configuration’ in the dependency is not an option because the publication of this module does not allow me to filter by configuration
I could explicitly declare the transitive dependency and use the ‘artifact only’ notation in order to filter the artifacts of the dependency, but in this case I will have to explicitly declare the version number of the transitive dependency (and I don’t really want to maintain the version in the gradle.build file in sync with the version declared in the other modules)
So I don’t really know how to solve this