Search classpath for files with extent in custom plugin

In the plugin I’m building, one thing I need to do is search the entire classpath for files with a particular extent. This would include searching in archive files found in the classpath. The analogous Maven plugin (I’m implementing a Gradle plugin to take the place of a Maven plugin) gets all the artifacts from the project using the Maven API and collects all of those directories and jar files. It then iterates through that collection, checking for a matching file if an entry is a directory or using the Zip classes to search for a matching file in an archive.

What is the proper way to do this in a Gradle plugin?

Eventually I’m going to allow the user to specify an optional configuration name, to limit the search to the dependencies in that configuration, but for now I’m going to use the “default”, although I’m not quite sure what that is.

I’ve figured out some of this. I can do something like the following:

project.configurations.each { conf ->
   println conf
   conf.allDependencies.each { dep ->
    println dep.dump()
    println dep
   }
  }

and I believe those “dep” objects have “name”, “group”, and “version” properties, but I imagine I have to do something about “dependency resolution” to get the actual jar file.

I also noticed this reply from Luke: http://forums.gradle.org/gradle/topics/get_installed_artifacts_jars_from_dependencies that talks about “Configuration.resolvedConfiguration()”, but that seemed to return zero resolved artifacts.