Upgrade Java version from 17 to 21 #64
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upgrade Java version from 17 to 21
Summary
This PR upgrades the Java version from 17 to 21 across the build configuration and Docker images. It also fixes an existing inconsistency where the
maven-compiler-pluginwas targeting Java 1.8 while the project property specified Java 17.Changes made:
pom.xml: Updatedjava.versionproperty from 17 to 21pom.xml: Fixedmaven-compiler-pluginsource/target from 1.8 to 21 (resolving version mismatch)Dockerfile: Updated builder stage frommaven:3.8.3-openjdk-17tomaven:3.8.3-openjdk-21Dockerfile: Updated runtime stage fromopenjdk:17-alpinetoopenjdk:21-alpineReview & Testing Checklist for Human
maven:3.8.3-openjdk-21andopenjdk:21-alpineexist on Docker Hub. If not, alternative tags likemaven:3.9-eclipse-temurin-21andeclipse-temurin:21-jre-alpinemay be needed.docker-compose up -d --buildand verify the application starts successfullyhttp://localhost:8080/actuator/healthreturns a healthy status after deploymentNotes
docker-compose.ymluses image variables (${DUSER}/${IMAGE}) and requires no changesmvn validate)Link to Devin run: https://app.devin.ai/sessions/d8ac35baae5243c6a01cdea90e60f5fd
Requested by: Shawn Azman (@ShawnAzman)