Skip to content

feature: migrate to Java 21 (LTS) and modernize Docker base images#263

Open
devin-ai-integration[bot] wants to merge 1 commit into
DevOpsfrom
devin/1782847567-java-21-upgrade
Open

feature: migrate to Java 21 (LTS) and modernize Docker base images#263
devin-ai-integration[bot] wants to merge 1 commit into
DevOpsfrom
devin/1782847567-java-21-upgrade

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 30, 2026

Copy link
Copy Markdown

Summary

Migrates the BankApp from its inconsistent Java config to Java 21 (LTS). Previously pom.xml had <java.version>17</java.version> but an explicit maven-compiler-plugin overrode it to compile for 1.8. This resolves that conflict and lets the spring-boot-starter-parent (3.3.3) manage compilation.

pom.xml

-<java.version>17</java.version>
+<java.version>21</java.version>

-<plugin>
-  <artifactId>maven-compiler-plugin</artifactId>   <!-- forced source/target 1.8 -->
-  <version>3.8.0</version>
-  <configuration><source>1.8</source><target>1.8</target></configuration>
-</plugin>

-<groupId>mysql</groupId>                  <!-- legacy coordinate -->
-<artifactId>mysql-connector-java</artifactId>
-<version>8.0.33</version>
+<groupId>com.mysql</groupId>              <!-- modern artifact, version managed by parent -->
+<artifactId>mysql-connector-j</artifactId>

Dockerfile (two-stage)

-FROM maven:3.8.3-openjdk-17 as builder      # deprecated openjdk-based maven tag
+FROM maven:3.9-eclipse-temurin-21 as builder
-FROM openjdk:17-alpine as deployer          # deprecated Docker Hub openjdk image
+FROM eclipse-temurin:21-jre-alpine as deployer

CI/CD & Kubernetes — no changes required

  • Jenkinsfile, GitOps/Jenkinsfile, and vars/*.groovy (incl. deploy.groovy) build via Docker / docker compose and contain no jdk tool declarations, Java-version agent images, or Maven steps pinned to Java 17 — the JDK is fully controlled by the Dockerfile.
  • kubernetes/bankapp-deployment.yml uses the app image tag trainwithshubham/bankapp-eks:v2 (not a Java-versioned base image); mysql:8.0 is unrelated. Nothing to update.

Verification

mvn clean verify with Java 21 (against a live MySQL 8): BUILD SUCCESS, compiles with release 21, tests pass (Tests run: 1, Failures: 0, Errors: 0). No deprecated-API or InaccessibleObjectException regressions surfaced.

Link to Devin session: https://app.devin.ai/sessions/c6aa88af32784ca094fc2d855cfa60ff
Requested by: @amitmanchella-cog


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

- pom.xml: java.version 17 -> 21, remove maven-compiler-plugin override
  (was forcing source/target 1.8); switch mysql-connector-java 8.0.33 ->
  com.mysql:mysql-connector-j (version managed by Spring Boot parent)
- Dockerfile: maven:3.8.3-openjdk-17 -> maven:3.9-eclipse-temurin-21 builder;
  openjdk:17-alpine -> eclipse-temurin:21-jre-alpine deployer

Co-Authored-By: Amit Manchella <amit.manchella@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

0 participants