Gradle, How To Disable All Transitive Dependencies

走远了吗. 提交于 2019-11-29 02:48:35

I ended up using:

configurations.all {
    transitive = false
}

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
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!