Migrate the Plugin Publish plugin to 1.x

MSAL

com.gradle.plugin-publish before 1.0 calls Jar.getArchivePath() and DefaultDecoratedConvention, removed in Gradle 8 and 9, so applying it fails with "Failed to notify project evaluation listener" once the wrapper is upgraded. Version 1.0 removed the pluginBundle { } block in turn, so bumping the version alone fails with "Could not find method pluginBundle()". This recipe does both at once: it moves website and vcsUrl onto gradlePlugin, and description, displayName and tags onto each plugin gradlePlugin { plugins { } } declares, then removes pluginBundle and upgrades the plugin to 1.3.1. tags = [..] on the declaration needs Gradle 8.2 or later, which MigrateToGradle8 upgrades to. A script with no gradlePlugin { plugins { } } of its own, which declares its plugins only in pluginBundle { plugins { } }, has that block written for it, taking each implementationClass from the checked-in META-INF/gradle-plugins/<id>.properties descriptor, which is then deleted: Gradle generates it from the declaration, and a checked-in copy of what it generates makes processResources fail on a duplicate entry from Gradle 7 on. A redundant descriptor is deleted for a plugin the script already declares, too. A script this recipe cannot migrate in full keeps its old plugin version, rather than being left bumped and broken: that is a pluginBundle holding mavenCoordinates, a version other than the project's, or anything else unrecognized, a declaration in pluginBundle { plugins { } } with no counterpart in gradlePlugin { plugins { } }, and a plugin declared in neither block or with no descriptor to take its implementation class from. Kotlin scripts are left alone. See the plugin-publish 1.0 release notes for more information.

org.openrewrite.gradle.migrate.plugins.MigratePluginPublishPlugin
mod run . --recipe=org.openrewrite.gradle.migrate.plugins.MigratePluginPublishPlugin

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.