Accessing dependency information and file at the same time


(Johannes Zillmann) #1

Hey there,

i’m iterating over the dependencies like described in http://www.gradle.org/docs/current/userguide/dependency_management.html

configurations.alllife.dependencies.each { dep -> println dep.name }

will give me the dependencies with access to name, version, etc…

configurations.alllife.files.each { file ->
        println file.name
    }

will give me the dependencies files !

Is there a way to get file and dep together ?

(Sorry i’m no groovy wizard) Johannes


(Luke Daley) #2

You need:

configurations.alllife.resolvedConfiguration.resolvedArtifacts

Which will give you a set of: http://www.gradle.org/docs/current/javadoc/org/gradle/api/artifacts/ResolvedArtifact.html


(Johannes Zillmann) #3

Thanks, that is working greatly!