How do you exclude a transitive project dependency in gradle

前端 未结 1 783
情书的邮戳
情书的邮戳 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)
提交回复
热议问题