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.


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

 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.