How to exclude transitive dependency

This should help http://gradle.org/docs/current/dsl/org.gradle.api.artifacts.dsl.DependencyHandler.html

http://gradle.org/docs/current/javadoc/org/gradle/api/artifacts/ModuleDependency.html#exclude(java.util.Map)

and here is the example given in the above:

apply plugin: ‘java’ //so that I can declare ‘compile’ dependencies

dependencies {

compile(‘org.hibernate:hibernate:3.1’) {

//excluding a particular transitive dependency:

exclude module: ‘cglib’ //by artifact name

exclude group: ‘org.jmock’ //by group

exclude group: ‘org.unwanted’, module: ‘iAmBuggy’ //by both name and group

}

} </code

Philip

1 Like