From 5d22ab366e496599234bdc279af1cfa51b7d8577 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:01:03 +0000 Subject: [PATCH 1/7] ci: configure JDK 11 in Jenkins pipeline Co-Authored-By: Joao Esteves --- Jenkinsfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 96e1e341..d58da0ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,8 +2,15 @@ pipeline { agent any + tools { + jdk 'JDK11' // Configure JDK 11 in Jenkins Global Tool Configuration + maven 'Maven3' // Ensure Maven 3.x is configured + } + environment{ SONAR_HOME = tool "Sonar" + JAVA_HOME = "${tool 'JDK11'}" + PATH = "${JAVA_HOME}/bin:${env.PATH}" } parameters { From 87ac9e9b448fe97895bd48ed80533ceeedd00088 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:01:10 +0000 Subject: [PATCH 2/7] docker: verify Java 11 compatibility in container configs - Updated Dockerfile to use maven:3.8.8-eclipse-temurin-11 for build stage - Updated Dockerfile to use eclipse-temurin:11-jre-alpine for runtime stage - Updated pom.xml to use Java 11 with maven-compiler-plugin 3.11.0 Co-Authored-By: Joao Esteves --- Dockerfile | 8 ++++---- pom.xml | 22 +++++++++++++--------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 079acabe..ba53cec7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,8 @@ # Stage 1 #---------------------------------- -# Import docker image with maven installed -FROM maven:3.8.3-openjdk-17 as builder +# Import docker image with maven installed (Java 11 for migration) +FROM maven:3.8.8-eclipse-temurin-11 as builder # Add maintainer, so that new user will understand who had written this Dockerfile MAINTAINER Madhup Pandey @@ -24,8 +24,8 @@ RUN mvn clean install -DskipTests=true # Stage 2 #-------------------------------------- -# Import small size java image -FROM openjdk:17-alpine as deployer +# Import small size java image (Java 11 for migration) +FROM eclipse-temurin:11-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..7c1300df 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,9 @@ - 17 + 11 + 11 + UTF-8 @@ -76,14 +78,16 @@ spring-boot-maven-plugin - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 1.8 - 1.8 - - + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 11 + + -Xlint:all + + + From a2d0bffe992f9808f57c5c6d7c240bdae9bba48f Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:02:53 +0000 Subject: [PATCH 3/7] build(maven): target Java 11 via release; upgrade surefire Co-Authored-By: Joao Esteves --- pom.xml | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index fc5bfeac..f9699b3a 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,9 @@ - 17 + 11 + 11 + UTF-8 @@ -78,12 +80,41 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + 3.11.0 - 1.8 - 1.8 + 11 + + -Xlint:all + + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.5 + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.2.5 + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.5.0 + + + enforce + + + + [11,) + + + + + + From e8e1f87c7098a7592e830ccb612d3297495e683d Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:04:11 +0000 Subject: [PATCH 4/7] build(maven): target Java 11 via release; upgrade surefire, add enforcer Co-Authored-By: Joao Esteves --- pom.xml | 45 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index fc5bfeac..3e179d47 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,9 @@ - 17 + 11 + 11 + UTF-8 @@ -52,8 +54,8 @@ - mysql - mysql-connector-java + com.mysql + mysql-connector-j 8.0.33 runtime @@ -67,6 +69,11 @@ spring-security-test test + + com.h2database + h2 + test + @@ -78,12 +85,38 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + 3.11.0 - 1.8 - 1.8 + 11 + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.5 + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.2.5 + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.5.0 + + + enforce + + + + [11,) + + + + + + From c16bc47608d3b9ac8a7f6098cb5d568b195767f4 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:04:17 +0000 Subject: [PATCH 5/7] test: add H2 database configuration for testing Co-Authored-By: Joao Esteves --- src/test/resources/application.properties | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/test/resources/application.properties diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties new file mode 100644 index 00000000..3c7cd18a --- /dev/null +++ b/src/test/resources/application.properties @@ -0,0 +1,12 @@ +spring.application.name=bankapp + +# H2 Database configuration for testing +spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE +spring.datasource.driverClassName=org.h2.Driver +spring.datasource.username=sa +spring.datasource.password= + +# JPA & Hibernate configuration for testing +spring.jpa.database-platform=org.hibernate.dialect.H2Dialect +spring.jpa.hibernate.ddl-auto=create-drop +spring.jpa.show-sql=true From 3d58f722464402054e5db5e93eb81c13054b8c6c Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:04:24 +0000 Subject: [PATCH 6/7] build: fix mvnw executable permission Co-Authored-By: Joao Esteves --- mvnw | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 mvnw diff --git a/mvnw b/mvnw old mode 100644 new mode 100755 From 1fa8099904161d6fab2a213ac5db3f7bca582ef1 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:04:30 +0000 Subject: [PATCH 7/7] docs: add migration notes and update README for Java 11 Co-Authored-By: Joao Esteves --- MIGRATION_NOTES.md | 80 ++++++++++++++++++++++++++++++++++++++++++++++ README.md | 18 +++++++++++ 2 files changed, 98 insertions(+) create mode 100644 MIGRATION_NOTES.md diff --git a/MIGRATION_NOTES.md b/MIGRATION_NOTES.md new file mode 100644 index 00000000..a76ad58d --- /dev/null +++ b/MIGRATION_NOTES.md @@ -0,0 +1,80 @@ +# Java 8 to Java 11 Migration Notes + +This document summarizes the changes made to migrate the Springboot-BankApp from Java 8 to Java 11. + +## Build Configuration Changes + +### Maven Compiler Plugin +The maven-compiler-plugin was updated from version 3.8.0 to 3.11.0 with the following configuration changes: + +- Replaced `1.8` and `1.8` with `11` +- The `release` flag ensures both source compatibility and bytecode target are set consistently + +### Java Version Properties +Updated properties in pom.xml: +- `java.version`: Changed from 17 to 11 +- Added `maven.compiler.release`: Set to 11 +- Added `project.build.sourceEncoding`: Set to UTF-8 + +### New Maven Plugins Added +The following plugins were added to ensure Java 11 compatibility and improve build quality: + +- **maven-surefire-plugin** (3.2.5): For running unit tests with Java 11 support +- **maven-failsafe-plugin** (3.2.5): For running integration tests +- **maven-enforcer-plugin** (3.5.0): Enforces minimum Java version requirement of 11 + +## Dependency Updates + +### MySQL Connector +Updated the MySQL connector artifact coordinates to the new reverse-DNS compliant Maven 2+ coordinates: +- Old: `mysql:mysql-connector-java:8.0.33` +- New: `com.mysql:mysql-connector-j:8.0.33` + +### Test Dependencies +Added H2 database dependency for testing: +- `com.h2database:h2` (test scope) + +This allows tests to run without requiring a MySQL database connection. + +## Test Configuration + +### Test Application Properties +Created `src/test/resources/application.properties` with H2 database configuration for testing: +- Uses in-memory H2 database (`jdbc:h2:mem:testdb`) +- Configured with H2Dialect for Hibernate +- Uses `create-drop` DDL auto mode for clean test isolation + +## Removed/Deprecated JDK Modules + +No JAXB, JAX-WS, CORBA, or JavaFX dependencies were found in this project. The application does not use any modules that were removed in Java 11. + +## Illegal Reflective Access + +No illegal reflective access warnings were observed during the build. The application and its dependencies are compatible with Java 11's module system. + +## Known Issues and Follow-ups + +### JPA Open-in-View Warning +The following warning appears during tests: +``` +spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. +``` +This is informational and can be addressed by explicitly setting `spring.jpa.open-in-view=false` in application.properties if desired. + +### JVM Sharing Warning +The following warning appears during tests: +``` +OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended +``` +This is a normal JVM warning when running with certain class loading configurations and does not affect functionality. + +## Validation + +- Build passes with `mvn clean verify` +- All tests pass on JDK 11+ +- No illegal reflective access warnings +- Maven enforcer plugin ensures Java 11+ is required + +## Compatibility + +This migration targets Java 11 as the minimum version. The application will also run on later LTS versions (Java 17, Java 21) due to backward compatibility. diff --git a/README.md b/README.md index 2f49958e..6b692cae 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,24 @@ - ArgoCD (CD) - AWS EKS (Kubernetes) - Helm (Monitoring using grafana and prometheus) + +## Java Requirements + +This application requires **Java 11** or later. The build is configured to target Java 11 bytecode and will enforce this minimum version requirement via the Maven Enforcer plugin. + +To build and run locally: +```bash +# Verify Java version (must be 11+) +java -version + +# Build the application +./mvnw clean package + +# Run tests +./mvnw test +``` + +For detailed migration notes from Java 8 to Java 11, see [MIGRATION_NOTES.md](MIGRATION_NOTES.md). ### Steps to deploy: