From 2320ca37ef7d4221188abbfbc2acddf76f52cf04 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 22:49:15 +0000 Subject: [PATCH 1/2] Migrate from Java 17 to Java 22 Phase 1-5 Migration Changes: - Update pom.xml java.version from 17 to 22 - Update maven-compiler-plugin source/target from 1.8 to 22 - Update Dockerfile build stage to maven:3.9-eclipse-temurin-22-alpine - Update Dockerfile runtime stage to eclipse-temurin:22-jre-alpine - Update README.md Jenkins installation to use openjdk-22-jre - Add JAVA22_MIGRATION_NOTES.md with deployment considerations Compatibility verified: - Spring Boot 3.3.3 supports Java 17-22 - MySQL Connector 8.0.33 compatible with Java 22 - Jenkinsfile and GitOps/Jenkinsfile reviewed and compatible Co-Authored-By: Satwik Bebortha --- Dockerfile | 4 +- JAVA22_MIGRATION_NOTES.md | 121 ++++++++++++++++++++++++++++++++++++++ README.md | 2 +- pom.xml | 18 +++--- 4 files changed, 133 insertions(+), 12 deletions(-) create mode 100644 JAVA22_MIGRATION_NOTES.md diff --git a/Dockerfile b/Dockerfile index 079acabe..d64af98d 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-22-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:22-jre-alpine as deployer # Copy build from stage 1 (builder) COPY --from=builder /src/target/*.jar /src/target/bankapp.jar diff --git a/JAVA22_MIGRATION_NOTES.md b/JAVA22_MIGRATION_NOTES.md new file mode 100644 index 00000000..2d084c99 --- /dev/null +++ b/JAVA22_MIGRATION_NOTES.md @@ -0,0 +1,121 @@ +# Java 17 to Java 22 Migration Notes + +## Overview +This document outlines the migration from Java 17 to Java 22 for the Springboot-BankApp application. + +## Compatibility Assessment + +### Spring Boot 3.3.3 +- Spring Boot 3.3.x officially supports Java 17-22 +- No Spring Boot version upgrade required +- All Spring Boot starters (Data JPA, Security, Thymeleaf, Web) are compatible with Java 22 + +### MySQL Connector 8.0.33 +- MySQL Connector/J 8.0.33 supports Java 8+ and is fully compatible with Java 22 +- No connector version upgrade required + +### Docker Images +- **Build Stage**: Updated from `maven:3.8.3-openjdk-17` to `maven:3.9-eclipse-temurin-22-alpine` + - Note: The original `maven:3.8.3-openjdk-22` image does not exist; using Eclipse Temurin distribution instead +- **Runtime Stage**: Updated from `openjdk:17-alpine` to `eclipse-temurin:22-jre-alpine` + - Note: The original `openjdk:22-alpine` image does not exist; using Eclipse Temurin distribution instead + +## Changes Made + +### Phase 2: Development Environment Migration + +#### pom.xml +- Updated `java.version` property from `17` to `22` +- Updated `maven-compiler-plugin` source and target from `1.8` to `22` + +#### Dockerfile +- Build stage: `maven:3.9-eclipse-temurin-22-alpine` +- Runtime stage: `eclipse-temurin:22-jre-alpine` + +### Phase 3: CI/CD Pipeline Migration + +#### README.md +- Updated Jenkins installation instructions to use `openjdk-22-jre` + +#### Jenkinsfile +- Reviewed and confirmed compatible with Java 22 +- Uses shared library functions that are Java version agnostic +- Docker build will use the updated Dockerfile with Java 22 images + +#### GitOps/Jenkinsfile +- Reviewed and confirmed compatible with Java 22 +- Handles image tags dynamically, no hardcoded Java version references + +## Phase 4: Staging Deployment Considerations + +### Pre-Deployment Checklist +1. Ensure staging EKS namespace is available +2. Verify ArgoCD is configured to sync from the java22-migration branch +3. Update ArgoCD application configuration to use new Java 22 image tags + +### Deployment Steps +1. Deploy updated Docker images to staging EKS namespace +2. Monitor pod startup and health checks +3. Verify application functionality through staging endpoints + +### Integration Testing +1. Perform end-to-end testing of all banking application functionality +2. Test user authentication and authorization flows +3. Verify database connectivity and JPA operations +4. Test Thymeleaf template rendering + +### Performance Monitoring +1. Compare startup time between Java 17 and Java 22 versions +2. Monitor memory usage and garbage collection metrics +3. Track response times for API endpoints + +## Phase 5: Production Deployment Considerations + +### Pre-Production Checklist +1. Complete all staging environment testing +2. Review security scan results (Trivy, OWASP, SonarQube) +3. Ensure rollback procedures are documented and tested + +### Deployment Strategy: Blue-Green +1. Deploy Java 22 version alongside existing Java 17 version +2. Configure load balancer for gradual traffic shifting +3. Monitor application metrics during traffic migration +4. Complete cutover once stability is confirmed + +### Rollback Preparation +1. Keep Java 17 Docker images available in registry +2. Maintain previous Kubernetes manifests for quick rollback +3. Configure monitoring alerts for Java 22 specific issues: + - JVM memory errors + - Class loading issues + - Reflection-related exceptions + +### Post-Deployment Monitoring +1. Monitor application logs for any Java 22 specific warnings +2. Track JVM metrics (heap usage, GC pauses, thread counts) +3. Monitor database connection pool health +4. Set up alerts for increased error rates + +## Security Scanning Compatibility + +### Trivy +- Filesystem and container image scanning compatible with Java 22 artifacts +- No configuration changes required + +### OWASP Dependency Check +- Compatible with Java 22 projects +- Will scan Maven dependencies regardless of Java version + +### SonarQube +- Code analysis compatible with Java 22 syntax +- Quality gates will function normally + +## Maintenance Window Recommendations + +### Suggested Timing +- Schedule deployment during low-traffic period (e.g., early morning or weekend) +- Allow 2-4 hours for complete migration and verification + +### Communication +- Notify stakeholders of planned maintenance window +- Prepare status update templates for deployment progress diff --git a/README.md b/README.md index 2f49958e..aac1e425 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ sudo su - Install Jenkins ```bash sudo apt update -y -sudo apt install fontconfig openjdk-17-jre -y +sudo apt install fontconfig openjdk-22-jre -y sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \ https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key diff --git a/pom.xml b/pom.xml index fc5bfeac..83d9cc7e 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ - 17 + 22 @@ -76,14 +76,14 @@ 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.8.0 + + 22 + 22 + + From 41881ad6cd80d29fdbcf1def639aed302195b134 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 00:30:00 +0000 Subject: [PATCH 2/2] Fix pom.xml indentation and update README.md for openjdk availability - Fix maven-compiler-plugin indentation to match rest of pom.xml - Update README.md to use openjdk-21-jre (openjdk-22-jre not available in Ubuntu repos) - Add note about Eclipse Temurin/Adoptium as alternative for Java 22 Verified: - Docker build succeeds with maven:3.9-eclipse-temurin-22-alpine and eclipse-temurin:22-jre-alpine - Application starts successfully with Java 22.0.2 Co-Authored-By: Satwik Bebortha --- README.md | 4 +++- pom.xml | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index aac1e425..f6b0aefc 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,11 @@ sudo su > [!Note] > Make sure the ssh-public-key "eks-nodegroup-key is available in your aws account" - Install Jenkins +> [!Note] +> openjdk-22-jre is not available in standard Ubuntu repositories. Use openjdk-21-jre (which supports running Java 22 compiled code) or install Java 22 from Eclipse Temurin/Adoptium. ```bash sudo apt update -y -sudo apt install fontconfig openjdk-22-jre -y +sudo apt install fontconfig openjdk-21-jre -y sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \ https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key diff --git a/pom.xml b/pom.xml index 83d9cc7e..62837e1d 100644 --- a/pom.xml +++ b/pom.xml @@ -76,14 +76,14 @@ spring-boot-maven-plugin - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 22 - 22 - - + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 22 + 22 + +