Gradle, How To Disable All Transitive Dependencies

If you want to have just one configuration block for all configurations you can use spread-dot operator to express this.

configurations {
    // other configurations e.g. - compile.exclude module: 'commons-logging'
    all*.transitive = false
}

In my case, I had a project (gradle module) depedency. I used the following to exclude the transitive dependencies in Gradle 3:

implementation(project(':<module_name>')) {
    transitive = false
}

Or in Kotlin script:

implementation(project(':<module_name>')) {
    isTransitive = false
}

I ended up using:

configurations.all {
    transitive = false
}