Skip to content

Chore/ Build with JDK 21 while keeping Java 8 for libs - #13

Open
NoahHsu wants to merge 4 commits into
mainfrom
chore/build-with-jdk-21
Open

NoahHsu wants to merge 4 commits into
mainfrom
chore/build-with-jdk-21

Conversation

@NoahHsu

@NoahHsu NoahHsu commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Switches the build and CI from JDK 8 to JDK 21. Published artifacts still target Java 8. This prepares for moving the Spring Boot starters to Spring Boot 3.5 / Java 17, which cannot be built on JDK 8.

  • Java 8 is still enforced: every module compiles with --release 8, which also catches JDK 8 API misuse (not only the bytecode level). The java extension still declares Java 8, so the published Gradle module metadata keeps org.gradle.jvm.version=8.
  • Java 8 is still tested: libs/ tests run on a JDK 8 toolchain. CI installs JDK 8 next to JDK 21; locally, the foojay resolver downloads JDK 8 when it is missing.
  • Error Prone: Gradle plugin 3.1.0 → 5.1.1, Error Prone 2.9.0 → 2.50.0. errorproneJavac is no longer needed.
  • Lombok 1.18.48 in all modules: the older versions outside libs/ do not support JDK 21.
  • Byte Buddy 1.18.15 for web starter tests: the version managed by Spring Boot 2.7 cannot mock on Java 21. Test scope only; it will be removed with the Spring Boot 3.5 upgrade.
  • Removes a no-op isEqualTo(first) assertion flagged by Error Prone SelfAssertion (AssertJ short-circuits on reference equality, so equals() was never called).

🤖 Generated with Claude Code

NoahHsu and others added 4 commits October 15, 2026 17:50
The Lombok versions used outside libs/ (1.18.20, 1.18.28, and the one managed by Spring Boot 2.7) do not support JDK 21.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Byte Buddy 1.12 managed by Spring Boot 2.7 cannot mock on Java 21. Test scope only; can be dropped once the starter moves to Spring Boot 3.5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
assertThat(first).isEqualTo(first) always passes because AssertJ short-circuits on reference equality, so it never exercised equals(). Flagged by Error Prone SelfAssertion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CI builds with JDK 21 and also installs JDK 8 for the test toolchain.
- Compile every module with --release 8, so JDK 8 API usage is
  checked, not just the bytecode level. The java extension still
  declares Java 8, so published Gradle module metadata keeps
  org.gradle.jvm.version=8.
- Run libs/ tests on a JDK 8 toolchain so Java 8 runtime behavior
  stays covered. The foojay resolver provisions JDK 8 locally when
  it is missing.
- Upgrade the Error Prone Gradle plugin to 5.1.1 and Error Prone to
  2.50.0; errorproneJavac is no longer needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NoahHsu
NoahHsu requested a review from fukuanru October 21, 2026 03:18
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