I recently checked a bunch of Gradle files in our multi modules project. It appeared people quite often just relies on transitive dependencies. Let me explain with an example:
Let’s say I’m working on project A which depends on project B. Project B at the same time depends on Guava. So in my case most likely I won’t specify a dependency on Guava in my build file for project A once I’ll start using it. I can just forget, in any case my project compiles just fine!
What I would like is to have a flag in Java plugin to only include direct dependencies during compilation. It will enforce users to specify all necessary dependencies. Also the classpath will be smaller and as a result compilation should be faster for big projects.
Does it make any sense? Maybe there is already a way to do it in Gradle? I know Blaze alike build systems like Bazel/Buck and Pants are already supporting it.