Apply plugins using the plugins block
MSALReplace a top-level apply plugin: statement with an entry in the plugins block, which Gradle can resolve before configuring the build and which tooling can read without running it. Only plugins Gradle itself ships are converted: a third-party plugin named in a plugins block needs a version, or a buildscript classpath entry the block cannot see, and rewriting one without resolving that would stop the build configuring. An apply inside subprojects or allprojects is left alone too, since a plugins block applies only to the script holding it, as is apply plugin: given a class rather than an id. See the Gradle best practice.
org. openrewrite. gradle. migrate. plugins. UsePluginsBlockmod run . --recipe= org. openrewrite. gradle. migrate. plugins. UsePluginsBlockInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.