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:

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:

Its focus is slightly different.