Is it possible to implement a "wrapper plugin" to "group" multiple custom pluings?

I have got multiple custom plugins.
Each with a different set of tasks (and thus functionality).

Today all my projects references (applies) all custom plugins in their build.gradle file.
Now I want to simplify this and “group” all custom plugins behind a “wrapper plugin”.
The project itself should only require to apply the “wrapper plugin”

I thought this is a “quick win” - but I failed.
I started to create a custom “wrapper plugin” and though I could just import the other custom plugins via the project.plugins.apply method.
However here I receive always a “plugin with id ‘xyz’ not found” exception.

So following question:

  • could my concept / idea work at all? Can I group multiple custom plugins behind another custom plugin and the project is still able to call tasks?
  • if yes: how can I troubleshoot the "plugin with id ‘xyz’ not found exception. How can I check which repos are searched? (the plugin itself is within my local maven repository).

Any hint is more than welcome.

Don’t use project.plugins.apply, have a look at the JavaDoc of project.plugins and you will learn that you should use project... or project.pluginManager... depending on what you need, but never project.plugins usually.

Your “wrapper” plugin is possible without problem, it is quite common that one plugin applies another plugin. But most probably simply forgot to add a dependency from your “wrapper” plugin to the other plugins and so nothing brings those custom plugins to the buildscript classpath and thus you cannot apply them by ID.

It is the same as if you would use the legacy apply(plugin = "a.b.c) without manually adding the plugin to the buildscript classpath.
Only when you apply the plugin from the plugins { ... } block in a build script, it gets added to the buildscript classpath automatically.