How do you exclude a transitive project dependency in gradle

前端 未结 1 776
情书的邮戳
情书的邮戳 2021-02-13 02:16

given

dependencies {
   compile project(\':subproject\') {
        transitive = false
   }
}

This does not work properly in gradle 1.3. (i.e. a

相关标签:
1条回答
  • 2021-02-13 02:27

    The shown syntax will add a new (so-called dynamic) transitive property to the Project object, which, unless used somewhere else, won't have any effect. You'll get a warning that dynamic properties have been deprecated, which is a sign of a potential mistake in the build script, and will fail hard in Gradle 2.0.

    The correct syntax is (as you already indicated):

    dependencies {
        compile(project(':subproject')) {
            transitive = false
        }
    } 
    
    0 讨论(0)
提交回复
热议问题