W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
執(zhí)行 gradle dependencies 命令會列出項目的依賴列表, 所有依賴會根據(jù)任務(wù)區(qū)分,以樹型結(jié)構(gòu)展示出來. 如下例:
例 11.13. 獲取依賴信息
gradle -q dependencies api:dependencies webapp:dependencies 的輸出結(jié)果
> gradle -q dependencies api:dependencies webapp:dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
No configurations
------------------------------------------------------------
Project :api - The shared API for the application
------------------------------------------------------------
compile
\--- org.codehaus.groovy:groovy-all:2.3.3
testCompile
\--- junit:junit:4.11
\--- org.hamcrest:hamcrest-core:1.3
------------------------------------------------------------
Project :webapp - The Web application implementation
------------------------------------------------------------
compile
+--- project :api
| \--- org.codehaus.groovy:groovy-all:2.3.3
\--- commons-io:commons-io:1.2
testCompile
No dependencies
雖然輸出結(jié)果很多, 但這對于了解構(gòu)建任務(wù)十分有用, 當(dāng)然你可以通過 --configuration 參數(shù)來查看 指定構(gòu)建任務(wù)的依賴情況:
例 11.14. 過濾依賴信息
gradle -q api:dependencies --configuration testCompile 的輸出結(jié)果
> gradle -q api:dependencies --configuration testCompile
------------------------------------------------------------
Project :api - The shared API for the application
------------------------------------------------------------
testCompile
\--- junit:junit:4.11
\--- org.hamcrest:hamcrest-core:1.3
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: