First, thanks for read me. I have created a new gradle plugin and now I would like to have the gradle internal configuration in the plugin build.gradle. For example with a closure, in order to set the plugin configuration dependencies.
At this point I think that I need to expand the problem context.
The idea is when the plugin consumer adds the plugin to their build.gradle, these dependencies (that are defined by default in the plugin) will be download in the consumer project.
In the first approach that run ok is setting this dependencies in the apply() method of the main plugin class. But I think that have the dependencies hardcoded in the class It’s not a good practice.
That is the point because I would like to have these dependencies defined in the build.gradle or in a config file (for example).
Trying your approach I see that the dependencies are only downloading in the plugin project, but not in the plugin consumer.
Another thing is that if try to get this config info in the plugin main class in the apply() method I have an error:
Could not get unknown property 'internalPluginCompileConfig' for configuration container of type
org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer