I believe there’s no built-in way in Gradle to achieve this (without adapting the build configuration) – unless you manually list the dependencies
task for all subprojects as in:
./gradlew sub1:dependencies sub2:dependencies sub1:subsub:dependencies
However, if you need this feature often enough, then you could create a shell alias for it. Example in bash (e.g., put this in your ~/.bashrc
file):
alias gradle-all-deps='./gradlew dependencies $(./gradlew -q projects
| grep -Fe --- Project
| sed -Ee "s/^.+--- Project '"'([^']+)'/1:dependencies/"'")'
Then simply call gradle-all-deps
from the root project directory.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…