Update Gradle project Java compatibility

Apache 2.0

Find and updates the Java compatibility for the Gradle project.

org.openrewrite.gradle.UpdateJavaCompatibility

Required

The Java version to upgrade to.

Optional

The compatibility type to change

The desired style to write the new version as when being written to the sourceCompatibility or targetCompatibility variables. Default, match current source style. (ex. Enum: JavaVersion.VERSION_11, Number: 11, or String: "11")

allowDowngradeBoolean

Allow downgrading the Java version.

addIfMissingBoolean

Adds the specified compatibility type if one is not found.

mod run . --recipe=org.openrewrite.gradle.UpdateJavaCompatibility \ -P version=11

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