Strategy for a plugin specifying a default set of dependencies

I am working on a plugin for xjc processing - https://github.com/sebersole/gradle-xjc-plugin. The plugin uses one of the multiple XJC Ant tasks for processing. At the moment the plugin requires the user to specify the Ant task to use and therefore the dependencies for it.

What I’d really like, however, is for the plugin to define a default task to use along with the dependencies for that default. I think this would require 2 different Configurations : one defined on the plugin for the defaults and the other exposed to the project for them to specify the non-default deps. However, I have no idea how to access the Configuration(s) of a plugin while it is executing, nor if that is even possible. Or is there a different way I should go about this?

Take a look at the way we do the CheckStyle/Pmd/etc plugins in Gradle:

https://github.com/gradle/gradle/blob/master/subprojects/code-quality/src/main/groovy/org/gradle/api/plugins/quality/PmdPlugin.groovy#L77

Basically, you’ll have a configuration that you’ll add dependencies to if the build script doesn’t provide them.

Makes perfect sense. Tried your approach and it worked like a champ: https://github.com/sebersole/gradle-xjc-plugin/blob/master/src/main/groovy/org/hibernate/build/gradle/xjc/XjcPlugin.groovy#L92

Thanks Sterling!