Custom Plugins that Depend on Other Plugins

My development group has several projects that rely on the sonarqube gradle plugin. We find ourselves repeating the same configuration information over and over. We’d like to create a custom plugin that essentially pre-configures the standard sonarqube plugin, but allows overrides if necessary.

  • Is this a good use case for a custom plugin?
  • If not, what might be a good approach besides distributing properties files?
  • How does a custom plugin that needs to “apply” an existing plugin pull in that plugin automatically to the build that uses the custom plugin? In my example, the custom sonarqube config plugin depends on sonarqube. If my project depends on the custom sonarqube config plugin, will the sonarqube plugin automatically be pulled into my project?

Are you still looking for some guidance with this?

I don’t know about them, but I sure am:)

The answer is yes, that is exactly what is called “convention plugin”, which can be implemented in various ways, for example as precompiled script plugins.
Just search for “convention plugin” in the docs and you have quite some guidance.
If you then have problems / question with the approach, don’t hesitate to open new threads or ask in the community Slack. :slight_smile:

2 Likes