I read this comment in the Gradle docs:
To deal with problems due to version conflicts, reports with dependency graphs
are also very helpful. Such reports ar
If you want to see dependencies on project and all subprojects use in your top-level build.gradle:
subprojects {
task listAllDependencies(type: DependencyReportTask) {}
}
Then call gradle:
gradle listAllDependencies
If you got a lot configurations the output might be pretty lengthy. To just show dependencies for the runtime configuration, run
gradle dependencies --configuration runtime
Ah, since I had no dependencies in my master project, "gradle dependencies" only lists those and not subproject dependencies so the correct command ended up being
gradle :<subproject>:dependencies
so for me this was
gradle :master:dependencies
If you want recursive to include subprojects, you can always write it yourself:
Paste into the top-level build.gradle
:
task allDeps << {
println "All Dependencies:"
allprojects.each { p ->
println()
println " $p.name ".center( 60, '*' )
println()
p.configurations.all.findAll { !it.allDependencies.empty }.each { c ->
println " ${c.name} ".center( 60, '-' )
c.allDependencies.each { dep ->
println "$dep.group:$dep.name:$dep.version"
}
println "-" * 60
}
}
}
Run with:
gradle allDeps
The command is gradle dependencies
, and its output is much improved in Gradle 1.2. (You can already try 1.2-rc-1 today.)
gradlew -q :app:dependencies > dependencies.txt
Will write all dependencies to the file dependencies.txt