Iterate all (including transitive) dependencies with a given groupId for a project?

I am writing a custom plugin where I need to iterate all dependencies for a war project including its transitive dependencies but only for a given groupId. Is there build-in functionality in gradle for this or do I need to write my own script for this?

Which version of Gradle do you need to target? Gradle 1.2 has better API for this.

I am using 1.2 and currently use more less the approach described here:

http://gradle.1045684.n5.nabble.com/transitive-dependency-list-td4793535.html

And how is that not working for you?

sorry it works :slight_smile: But maybe there was a simpler way like: project.getDependencyTree() that would eg. return an iterator to the root.

Gradle 1.2 introduced a new (incubating) API that may be easier to work with depending on what you want: http://gradle.org/docs/current/release-notes#dependency-resolution-result-api

Its focus is slightly different.