This should help http://gradle.org/docs/current/dsl/org.gradle.api.artifacts.dsl.DependencyHandler.html
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