Reputation: 5469
How can I exclude:
com.sun.xml.bind:*:*
from all projects, all configurations, regardless of version?
I need to replace them with:
'org.glassfish.jaxb:jaxb-xjc:2.2.11'
'org.glassfish.jaxb:jaxb-runtime:2.2.11'
...
in accordance with:
https://github.com/jacobono/gradle-jaxb-plugin/issues/15
....hmmm... Is there a way to replace them in one step?
Upvotes: 10
Views: 11727
Reputation: 44369
According to the Gradle User Guide on Dependency Management explains, you can exclude all versions of a given dependency from all configurations:
configurations.all {
exclude group: 'com.sun.xml.bind'
}
Then just add the glassfish dependencies (may need compile instead of runtime configuration)
dependencies {
runtime 'org.glassfish.jaxb:jaxb-xjc:2.2.11'
runtime 'org.glassfish.jaxb:jaxb-runtime:2.2.11'
}
Alternatively, you could try dependency substitution, but that might be hairy.
Upvotes: 15