What is the Gradle artifact dependency graph command?

前端 未结 8 1475
独厮守ぢ
独厮守ぢ 2020-11-28 03:34

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         


        
8条回答
  •  天涯浪人
    2020-11-28 04:20

    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
    

提交回复
热议问题