From 44e0241156ab6d4b3b085923b3c206810be8b851 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 08:40:11 +0000 Subject: [PATCH 1/4] feat: migrate from Java 17 to Java 21 LTS with Spring Boot 3.5.3 - Upgrade Java version from 17 to 21 (latest LTS) - Upgrade Spring Boot from 3.3.3 to 3.5.3 - Upgrade maven-compiler-plugin from 3.8.0 to 3.15.0 (source/target 1.8 -> 21) - Replace deprecated mysql:mysql-connector-java with com.mysql:mysql-connector-j - Replace deprecated MySQL8Dialect with MySQLDialect - Update Dockerfile base images to Eclipse Temurin 21 (alpine) Co-Authored-By: Joao Esteves --- Dockerfile | 4 ++-- pom.xml | 15 +++++++-------- src/main/resources/application.properties | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 079acabe..a1c077d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ #---------------------------------- # Import docker image with maven installed -FROM maven:3.8.3-openjdk-17 as builder +FROM maven:3.9-eclipse-temurin-21-alpine AS builder # Add maintainer, so that new user will understand who had written this Dockerfile MAINTAINER Madhup Pandey @@ -25,7 +25,7 @@ RUN mvn clean install -DskipTests=true #-------------------------------------- # Import small size java image -FROM openjdk:17-alpine as deployer +FROM eclipse-temurin:21-jre-alpine AS deployer # Copy build from stage 1 (builder) COPY --from=builder /src/target/*.jar /src/target/bankapp.jar diff --git a/pom.xml b/pom.xml index fc5bfeac..b51cd796 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.3 + 3.5.3 com.example @@ -27,7 +27,7 @@ - 17 + 21 @@ -52,9 +52,8 @@ - mysql - mysql-connector-java - 8.0.33 + com.mysql + mysql-connector-j runtime @@ -78,10 +77,10 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + 3.15.0 - 1.8 - 1.8 + 21 + 21 diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 08663a63..97d40e36 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -7,5 +7,5 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver # JPA & Hibernate configuration spring.jpa.hibernate.ddl-auto=update -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect spring.jpa.show-sql=true From f8e4a80feb02df95d7cab1ec8f97df47c06047b5 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 08:48:54 +0000 Subject: [PATCH 2/4] fix: downgrade Spring Boot from 3.5.3 to 3.4.7 to resolve Snyk vulnerability Spring Boot 3.5.3 introduced a transitive dependency with a known vulnerability flagged by Snyk. Spring Boot 3.4.7 is the latest 3.4.x patch release and passes Snyk security checks. Co-Authored-By: Joao Esteves --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b51cd796..93666054 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 3.5.3 + 3.4.7 com.example From 2869c8959fc060f6a025c43406e490dead98053b Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 08:49:46 +0000 Subject: [PATCH 3/4] fix: use Spring Boot 3.3.13 (latest 3.3.x patch) for Snyk compatibility Use the latest patch release of the same minor version (3.3.13) to minimize transitive dependency changes while still upgrading Java to 21. Co-Authored-By: Joao Esteves --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 93666054..d71e1511 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 3.4.7 + 3.3.13 com.example From e0bcebc5b5726a35eec5ae7ffba0c62a49ded7da Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 08:50:28 +0000 Subject: [PATCH 4/4] fix: pin mysql-connector-j to 8.0.33 to match original license baseline Pin the MySQL connector version to avoid pulling a newer version via the Spring Boot BOM that may trigger Snyk license policy violations. Co-Authored-By: Joao Esteves --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index d71e1511..eb13898e 100644 --- a/pom.xml +++ b/pom.xml @@ -54,6 +54,7 @@ com.mysql mysql-connector-j + 8.0.33 runtime