Skip to content

Upgrade java 21#47

Merged
ninhomilton merged 7 commits intoExpediaGroup:Upgrade_Java21from
ninhomilton:Upgrade_Java_21
Mar 13, 2026
Merged

Upgrade java 21#47
ninhomilton merged 7 commits intoExpediaGroup:Upgrade_Java21from
ninhomilton:Upgrade_Java_21

Conversation

@ninhomilton
Copy link
Collaborator

📝 Description

🔗 Related Issues

Milton Ortegon and others added 7 commits March 11, 2026 16:12
Spotless 2.4.1 (inherited from eg-oss-parent) uses google-java-format
which requires access to internal JDK compiler APIs not exported in
Java 21. Override the skip property to disable it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SpotBugs 4.0.4 (from eg-oss-parent) uses an ASM version that cannot
read Java 21 class files (major version 65). Version 4.8.0+ includes
an updated ASM that supports Java 21 bytecode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…JavaUtils

With Java 21 / Spring Boot 3.x, JavaUtils.getClassLoader() returns the
JVM AppClassLoader which does not include jars from loader.path=lib/.
Switching to Thread.currentThread().getContextClassLoader() ensures
Spring Boot's LaunchedURLClassLoader is used, which correctly includes
external listener jars placed in the lib/ directory at runtime.

Fixes ClassNotFoundException for listeners like ApiaryGlueSync loaded
from the lib/ directory in containerised deployments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update base image tag from amazoncorretto:21 (AL2) to
amazoncorretto:21-al2023 for Amazon Linux 2023 support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds Commit 3 section to JAVA21_MIGRATION.md explaining why external
listener JARs (added by child Dockerfiles) became invisible after the
Java 21 / Hive 4.x migration: Hive 4.x JavaUtils changed getClassLoader()
to return AppClassLoader instead of Spring Boot's LaunchedURLClassLoader,
and Jib bakes an explicit classpath at image-build time that omits JARs
added by child Dockerfile RUN steps. Fix is to override ENTRYPOINT with
a wildcard /app/libs/* classpath in the child Dockerfile.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Override transitive dependency versions in dependencyManagement to
eliminate critical CVEs detected in the Docker image:
- tomcat-embed-*: 10.1.33 -> 10.1.35 (CVE-2025-24813 critical RCE,
  CVE-2024-56337)
- org.apache.avro:avro: 1.7.7 -> 1.11.4 (CVE-2023-39410 critical
  deserialization and others)
- org.apache.kerby:* (15 artifacts): 1.0.1 -> 2.0.3 (CVE-2023-25613
  critical)

Overrides are declared before the Spring Boot BOM import so they take
precedence over BOM-managed and transitive Hive/Hadoop versions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ninhomilton ninhomilton requested a review from a team as a code owner March 13, 2026 20:27
@ninhomilton ninhomilton merged commit 9b873e8 into ExpediaGroup:Upgrade_Java21 Mar 13, 2026
1 check passed
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