I am trying to develop a custom plugin on top of the SpringBootPlugin and a few others that would ship my team options about how we would like to have as common in our builds.
One hurdle I am facing at the moment is that I would like this plugin to customize the pluginManagement section of the setting.gradle of the projects where it would be applied to.
How can I add new repositories to the pluginManagement section of the downstream projects this custom plugin is applied to ?
As long as these repositories are just for project plugins, not for settings plugins, write additionally a settings plugin that does this configuration and can then be applied downstream.
Thank you, but how do we apply a settings plugin to a build ? Is it the same way as normal plugin ?
Yes, just in the settings script, not in the build script.
Ok thank you @Vampire one last question, this plugin I would like to create is to define new additional internal repositories, to fetch build plugins so my setting.gradle would also have to have the company own private internal nexus to find this custom plugin ?
Yes, the settings script will need to have the repository if the settings plugin needs a special repository, as a settings plugin is of course too late to define the repository where to find settings plugins. You could maybe do it with an
init plugin, but then you have to have the repository there. Or you could use a custom distribution with an init script that does it, but then you have to have a custom distribution.
Somewhere you have to define the entrypoint.