Skip to content

Upgrade to Java 21#903

Closed
vasiliy-mikhailov wants to merge 1 commit into
OWASP:devfrom
vasiliy-mikhailov:bump-java-21
Closed

Upgrade to Java 21#903
vasiliy-mikhailov wants to merge 1 commit into
OWASP:devfrom
vasiliy-mikhailov:bump-java-21

Conversation

@vasiliy-mikhailov

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

Copy link
Copy Markdown

Upgrades the build from Java 17 to Java 21 (current LTS).

  • pom.xml: maven-compiler-plugin <release> 17 → 21
  • .github/workflows/test.yml & release.yml: java-version 17 → 21, so CI builds on the new target (otherwise the JDK-17 runners can't compile a release-21 build)

Verification: the project compiles under JDK 21 and all 162 unit tests pass, with none lost versus the JDK-17 baseline. Integration tests that need external services (MongoDB/MariaDB/Docker) were not run locally and are unchanged. No production or test code was modified — 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: 21
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 162 tests pass under JDK 21, none lost versus the baseline.

Raise the maven-compiler-plugin release from 17 to 21 and bump the CI/release
workflow JDK to match. All 162 unit tests pass under JDK 21 with none lost.
@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.

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant