Move sourceCompatibility and targetCompatibility into the java { } extension block

MSAL

Gradle 9 removed the JavaPluginConvention (deprecated in 8.2). Top-level sourceCompatibility and targetCompatibility assignments in a Groovy build script previously delegated to that convention object and stop working in Gradle 9. Move them into the java { } extension block, normalizing values to JavaVersion.VERSION_<n> and adding the missing counterpart so both properties are set explicitly. See the Gradle upgrade guide for more information.

org.openrewrite.gradle.migrate.java.UseJavaExtensionBlock
mod run . --recipe=org.openrewrite.gradle.migrate.java.UseJavaExtensionBlock

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