I see examples for disabling compile time transitive dependencies like this:
//configuring existing configurations not to put transitive dependencies on the compile classpath //this way you can avoid issues with implicit dependencies to transitive libraries compile.transitive = false testCompile.transitive = false
However when I tried this I was surprised to see that my compile classpath still included transitive dependencies.
After digging into this further it seems that you should really disable transitivity on the compileClasspath and testCompileClasspath configurations. These are the leaf configurations that are actually used by the compileJava and compileTestJava tasks. True, they extend from compile/testCompile, however extended configurations do not appear to actually inherit the transitivity setting (running the project-report plugin illustrates this nicely)
So all this being the case, is there really ever a reason to set
transitive = false on the compile/testCompile configurations, or should you in fact always do this on the compileClasspath and testCompileClasspath configurations?