Last Updated: February 25, 2016
·
5.188K
· gamussa

Gradle: collect application dependencies

I'm using gradle as build tool on current project. Gradle has great dependency management features. Gradle can easily fetch application dependencies from maven central repositories. But some time you need to collect all dependencies jars locally (e.g. to figure out dependencies of dependencies or what actual jars you depend on).
This task could be done by followed gradle task:

task collectJars(type: Copy){
    into "$buildDir/output/lib"
    from configurations.testRuntime
}

After running

gradle collectJars

you can find all you dependencies in you build/output/lib directory