How to exclude transitive dependencies of a dependency?

How do I declare a dependency but exclude all of its transitive dependencies? If it makes any difference, this is in a scala project.

Thanks

Hi, you can set the transitive property of a dependency to false. the example below excludes all transitive dependencies of junit:

dependencies{
 testCompile ("junit:junit:4.9"){
  transitive = false
 }
 }

regards, René

Thanks for the quick response. That works perfectly.

And I just found the documentation page that shows an example.

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