W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
執(zhí)行 gradle dependencies 命令會(huì)列出項(xiàng)目的依賴列表, 所有依賴會(huì)根據(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é)果很多, 但這對(duì)于了解構(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號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: