Order of plugins in plugins block has no bearing on actual order they are applied?

Does the order of the plugin in the plugins block matter? Are they applied in the order they are specified. I’m running into an issue with a plugin I own where it cannot resolve the assemble task even though I’ve already specified the java plugin before it in the plugins block. Strangely did not encounter this behavior when I used the old style buildscript plugin AND none of my tests seemed to be okay with it.

plugins {
  id `java`
  id `my-plugin` version `X`

Your plugin should apply the “base” plugin as the first thing it does. Then you could be guaranteed that the “assemble” task exists in your plugin, regardless of what people do in their build script when using your plugin.

This is how the “java” plugin and many other gradle plugins work.

Yeah that’s what I ended up doing. Thanks for the update.