Skip to content

Upgrade to Java 17#552

Closed
vasiliy-mikhailov wants to merge 2 commits into
microsoft:mainfrom
vasiliy-mikhailov:bump-java-17
Closed

Upgrade to Java 17#552
vasiliy-mikhailov wants to merge 2 commits into
microsoft:mainfrom
vasiliy-mikhailov:bump-java-17

Conversation

@vasiliy-mikhailov

@vasiliy-mikhailov vasiliy-mikhailov commented Jun 24, 2026

Copy link
Copy Markdown

Upgrades the build from Java 11 to Java 17 (LTS).

  • pom.xml: maven.compiler.release 11 → 17; the maven-compiler-plugin <source>/<target> were set to the literal {maven.compiler.release} (missing $, so not actually interpolated) — replaced with <release>17</release>
  • .github/workflows/* (early_access, jreleaser, publish, release_to_github): java-version 11 → 17 so CI/release build on the new target

Verification: the project compiles under JDK 17 and all 203 tests pass, with none lost versus the JDK-11 baseline. No production or test code was changed — only the compiler target and the CI JDK.


How this was produced

The compiler-target change was produced with OpenRewrite's UpgradeJavaVersion recipe:

# rewrite.yml
type: specs.openrewrite.org/v1beta/recipe
name: com.example.UpgradeJava
recipeList:
  - org.openrewrite.java.migrate.UpgradeJavaVersion:
      version: 17
mvn -U org.openrewrite.maven:rewrite-maven-plugin:RELEASE:run \
  -Drewrite.configLocation=$(pwd)/rewrite.yml \
  -Drewrite.activeRecipes=com.example.UpgradeJava \
  -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE

The diff was then reduced by hand to the minimal compiler-target change, and the CI workflow java-version was updated to match (OpenRewrite does not edit GitHub Actions).

Verified: all 203 tests pass under JDK 17, none lost versus the baseline.

Raise maven.compiler.release from 11 to 17 (and fix the malformed compiler
source/target -> release), and bump the CI workflow JDKs to match. All 203
tests pass under JDK 17 with none lost.
@vasiliy-mikhailov

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

The project now targets Java 17 (maven.compiler.release=17), so building and CodeQL-analyzing at JDK 11 fails; fail-fast then cancels the 17 and 21 jobs. Test only 17 and 21.
@vasiliy-mikhailov

Copy link
Copy Markdown
Author

Closing this out — on reflection a standalone Java-version bump isn't really worth your review time without a clear benefit, and I didn't want to leave it sitting in your queue. Thanks for the work on this project.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant