Upgrade Java version required by Maven plugins
MSALUpgrade the Java version that Maven plugins select or require beside the one the compiler targets: the jdkToolchain of plugins such as maven-compiler-plugin and maven-surefire-plugin, the jdk toolchain that maven-toolchains-plugin requires or selects, and the requireJavaVersion rule of maven-enforcer-plugin. Left behind, these make the build fail on, or keep it away from, the JDK it was just upgraded to. A version or the lower bound of a version range is raised, as is an exclusive upper bound that would rule out the new version, and so is a property of the same pom.xml that the version or an open-ended range refers to. A requireJavaVersion message that names the old version alone, as in Java 17 or JDK 17+, is updated to match, while one that names several versions, as in JDK 8 to 12, is left for a person to reword. Ranges that cap the Java version in any other way are left untouched, as is a jdkToolchain beside a release, source or target that stays on an older version, such as one layer of a multi-release jar, and versions that are already at or beyond the new version.
org. openrewrite. java. migrate. UpgradeMavenPluginJavaVersionRequired
The Java version to upgrade to.
mod run . --recipe= org. openrewrite. java. migrate. UpgradeMavenPluginJavaVersion \
-P version=25Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.