[英]See dependency tree for single configuration in gradle (using `dependencies` task)
每當我在gradle項目上調用gradlew dependencies
時,我會得到每個配置的依賴項列表(當只配置編譯時,通常包括為運行時,test和testRuntime重復多次的相同事務)。
有沒有辦法指定特定的配置來查看依賴關系?
命令是: gradle[w] dependencies --configuration <configuration_name>
在我的情況下,我想看到只是編譯配置,所以我會鍵入:
gradlew dependencies --configuration compile
如果您還想按模塊過濾,可以使用以下命令:
gradlew -p <module-name> dependencies --configuration <configuration-name>
因此,例如,如果要輸出所有依賴關系圖,請使用:
gradlew dependencies
因此,例如,如果要輸出lib
模塊的所有依賴關系圖,請使用:
gradlew -p lib dependencies
如果要為調試變量輸出編譯依賴項:
gradlew dependencies --configuration debugCompileClasspath
如果要為調試變量輸出運行時依賴項:
gradlew dependencies --configuration debugRuntimeClasspath
如果要在lib
模塊中輸出調試變量和生產風格的運行時依賴性:
gradlew -p lib dependencies --configuration productionDebugRuntimeClasspath
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.