How to get groupId:artifactId:version for all transitive dependencies?

I am trying to figure how to iterate over all dependencies including transitive and get all groupId:artifactId:version and then maybe filter on groupId.

Figured it out

configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact artifact ->

def id = artifact.moduleVersion.id

println “$artifact.file, $id.group, $id.name, $id.version” }