From 8fb5ae324029c5ea1aa3668866c9f6b360431cda Mon Sep 17 00:00:00 2001
From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 03:29:42 +0000
Subject: [PATCH 1/7] build(maven): target Java 11 via release; upgrade
surefire/failsafe plugins
- Downgrade Spring Boot from 3.3.3 to 2.7.18 (LTS) for Java 11 compatibility
- Update maven-compiler-plugin to 3.11.0 with 11
- Upgrade maven-surefire-plugin to 3.2.5
- Upgrade maven-failsafe-plugin to 3.2.5
- Add maven-enforcer-plugin 3.5.0 to require Java 11+
- Change thymeleaf-extras-springsecurity6 to springsecurity5
- Add H2 database dependency for testing
Co-Authored-By: Cindy Huang
---
pom.xml | 61 +++++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 53 insertions(+), 8 deletions(-)
diff --git a/pom.xml b/pom.xml
index fc5bfeac..32fa46b5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.springframework.boot
spring-boot-starter-parent
- 3.3.3
+ 2.7.18
com.example
@@ -27,7 +27,9 @@
- 17
+ 11
+ 11
+ UTF-8
@@ -48,7 +50,7 @@
org.thymeleaf.extras
- thymeleaf-extras-springsecurity6
+ thymeleaf-extras-springsecurity5
@@ -67,9 +69,53 @@
spring-security-test
test
+
+ com.h2database
+ h2
+ test
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.11.0
+
+ 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,)
+
+
+
+
+
+
+
+
org.springframework.boot
@@ -78,11 +124,10 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.8.0
-
- 1.8
- 1.8
-
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
From 0d069c9e3f927b8229ad9d52a76934d188912951 Mon Sep 17 00:00:00 2001
From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 03:29:50 +0000
Subject: [PATCH 2/7] deps: update JPA imports from jakarta to javax for Spring
Boot 2.7.x
- Change jakarta.persistence imports to javax.persistence in Account.java
- Change jakarta.persistence imports to javax.persistence in Transaction.java
- Add UserDetails interface methods to Account.java for Spring Security 5
Co-Authored-By: Cindy Huang
---
.../com/example/bankapp/model/Account.java | 22 ++++++++++++++++++-
.../example/bankapp/model/Transaction.java | 2 +-
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/example/bankapp/model/Account.java b/src/main/java/com/example/bankapp/model/Account.java
index b5e3f17d..1185cb66 100644
--- a/src/main/java/com/example/bankapp/model/Account.java
+++ b/src/main/java/com/example/bankapp/model/Account.java
@@ -1,6 +1,6 @@
package com.example.bankapp.model;
-import jakarta.persistence.*;
+import javax.persistence.*;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
@@ -84,4 +84,24 @@ public List getTransactions() {
public void setTransactions(List transactions) {
this.transactions = transactions;
}
+
+ @Override
+ public boolean isAccountNonExpired() {
+ return true;
+ }
+
+ @Override
+ public boolean isAccountNonLocked() {
+ return true;
+ }
+
+ @Override
+ public boolean isCredentialsNonExpired() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return true;
+ }
}
diff --git a/src/main/java/com/example/bankapp/model/Transaction.java b/src/main/java/com/example/bankapp/model/Transaction.java
index b3f371f9..f9bdcb1e 100644
--- a/src/main/java/com/example/bankapp/model/Transaction.java
+++ b/src/main/java/com/example/bankapp/model/Transaction.java
@@ -1,6 +1,6 @@
package com.example.bankapp.model;
-import jakarta.persistence.*;
+import javax.persistence.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
From d2f06204edb03f384eb0d95c1b7b5eb135674616 Mon Sep 17 00:00:00 2001
From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 03:29:58 +0000
Subject: [PATCH 3/7] security: update SecurityConfig for Spring Security 5 API
- Change from Spring Security 6 lambda DSL to Spring Security 5 method chaining
- Replace requestMatchers() with antMatchers()
- Replace authorizeHttpRequests() with authorizeRequests()
- Update logout, formLogin, and headers configuration
Co-Authored-By: Cindy Huang
---
.../bankapp/config/SecurityConfig.java | 23 +++++++++----------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/src/main/java/com/example/bankapp/config/SecurityConfig.java b/src/main/java/com/example/bankapp/config/SecurityConfig.java
index 4dbd1572..c3e929cc 100644
--- a/src/main/java/com/example/bankapp/config/SecurityConfig.java
+++ b/src/main/java/com/example/bankapp/config/SecurityConfig.java
@@ -27,27 +27,26 @@ public static PasswordEncoder passwordEncoder() {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
- .csrf(csrf -> csrf.disable())
- .authorizeHttpRequests(authz -> authz
- .requestMatchers("/register").permitAll()
+ .csrf().disable()
+ .authorizeRequests()
+ .antMatchers("/register").permitAll()
.anyRequest().authenticated()
- )
- .formLogin(form -> form
+ .and()
+ .formLogin()
.loginPage("/login")
.loginProcessingUrl("/login")
.defaultSuccessUrl("/dashboard", true)
.permitAll()
- )
- .logout(logout -> logout
+ .and()
+ .logout()
.invalidateHttpSession(true)
.clearAuthentication(true)
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.logoutSuccessUrl("/login?logout")
.permitAll()
- )
- .headers(headers -> headers
- .frameOptions(frameOptions -> frameOptions.sameOrigin())
- );
+ .and()
+ .headers()
+ .frameOptions().sameOrigin();
return http.build();
}
@@ -57,4 +56,4 @@ public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception
auth.userDetailsService(accountService).passwordEncoder(passwordEncoder());
}
-}
\ No newline at end of file
+}
From d6d4f0fa3cdea3fdce074eddc0a29aa4724ba69d Mon Sep 17 00:00:00 2001
From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 03:30:04 +0000
Subject: [PATCH 4/7] config: update Hibernate dialect for Spring Boot 2.7.x
- Change MySQL8Dialect to MySQL57Dialect for Hibernate 5 compatibility
Co-Authored-By: Cindy Huang
---
src/main/resources/application.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 08663a63..5dfad87b 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.MySQL57Dialect
spring.jpa.show-sql=true
From 0bf5567fb06cdd33a32b8028692378256e411b49 Mon Sep 17 00:00:00 2001
From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 03:30:11 +0000
Subject: [PATCH 5/7] test: add H2 database configuration for testing
- Add test-specific application.properties with H2 in-memory database
- Configure H2 dialect and create-drop DDL for test isolation
Co-Authored-By: Cindy Huang
---
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 e6c147e3ea2dd7c3921dcc41c996a14f97d21b5c Mon Sep 17 00:00:00 2001
From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 03:30:20 +0000
Subject: [PATCH 6/7] ci: add JDK 11 workflow with cache
- Add GitHub Actions workflow for Java 11 builds
- Use Temurin JDK 11 distribution
- Include Maven caching for faster builds
Co-Authored-By: Cindy Huang
---
.github/workflows/java11-build.yml | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100644 .github/workflows/java11-build.yml
diff --git a/.github/workflows/java11-build.yml b/.github/workflows/java11-build.yml
new file mode 100644
index 00000000..0ac9e871
--- /dev/null
+++ b/.github/workflows/java11-build.yml
@@ -0,0 +1,27 @@
+name: Java 11 Build
+
+on:
+ push:
+ branches: [ DevOps, main, master ]
+ pull_request:
+ branches: [ DevOps, main, master ]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup JDK 11
+ uses: actions/setup-java@v4
+ with:
+ distribution: temurin
+ java-version: '11'
+ cache: maven
+
+ - name: Build with Maven
+ run: mvn -B -e -DskipTests clean verify
+
+ - name: Run Tests
+ run: mvn -B test
From 8ad3e2681568c46dd0c5d6558fd4f1b93237756c Mon Sep 17 00:00:00 2001
From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 03:30:28 +0000
Subject: [PATCH 7/7] docs: add migration notes and update README
- Add MIGRATION_NOTES.md summarizing Java 8 to 11 migration changes
- Update README.md with Java 11 requirement
Co-Authored-By: Cindy Huang
---
MIGRATION_NOTES.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++
README.md | 7 +++++
2 files changed, 77 insertions(+)
create mode 100644 MIGRATION_NOTES.md
diff --git a/MIGRATION_NOTES.md b/MIGRATION_NOTES.md
new file mode 100644
index 00000000..5a9d95a7
--- /dev/null
+++ b/MIGRATION_NOTES.md
@@ -0,0 +1,70 @@
+# Java 8 to Java 11 Migration Notes
+
+This document summarizes the changes made to migrate the Springboot-BankApp from Java 8 to Java 11.
+
+## Summary of Changes
+
+### Build Configuration (pom.xml)
+
+The following changes were made to support Java 11:
+
+**Spring Boot Version**: Downgraded from 3.3.3 to 2.7.18 (LTS) because Spring Boot 3.x requires Java 17+, while Spring Boot 2.7.x supports Java 8-17.
+
+**Java Version**: Updated from Java 8 to Java 11 using the `11` configuration in maven-compiler-plugin.
+
+**Maven Plugins Updated**:
+- maven-compiler-plugin: 3.11.0 (with `11`)
+- maven-surefire-plugin: 3.2.5
+- maven-failsafe-plugin: 3.2.5
+- maven-enforcer-plugin: 3.5.0 (enforces Java 11+ requirement)
+
+**Dependencies Changed**:
+- thymeleaf-extras-springsecurity6 -> thymeleaf-extras-springsecurity5 (Spring Security 5 for Spring Boot 2.7.x)
+- Added H2 database for testing (test scope)
+
+### Source Code Changes
+
+**Model Classes (Account.java, Transaction.java)**:
+- Changed `jakarta.persistence.*` imports to `javax.persistence.*` (Jakarta EE namespace is used in Spring Boot 3.x, Java EE namespace in Spring Boot 2.7.x)
+- Added UserDetails interface methods to Account.java: `isAccountNonExpired()`, `isAccountNonLocked()`, `isCredentialsNonExpired()`, `isEnabled()`
+
+**SecurityConfig.java**:
+- Updated from Spring Security 6 lambda DSL to Spring Security 5 method chaining style
+- Changed `requestMatchers()` to `antMatchers()`
+- Changed `authorizeHttpRequests()` to `authorizeRequests()`
+- Updated logout, formLogin, and headers configuration to use `.and()` chaining
+
+### Configuration Changes
+
+**application.properties**:
+- Changed Hibernate dialect from `MySQL8Dialect` to `MySQL57Dialect` for Hibernate 5 compatibility
+
+**Test Configuration**:
+- Added `src/test/resources/application.properties` with H2 in-memory database configuration for testing
+
+### CI/CD
+
+**GitHub Actions**:
+- Added `.github/workflows/java11-build.yml` workflow for JDK 11 builds
+- Uses Temurin JDK 11 distribution
+- Includes Maven caching for faster builds
+
+## Validation
+
+- Build compiles successfully with Java 11
+- All tests pass with H2 in-memory database
+- Maven enforcer plugin ensures Java 11+ is required
+
+## Known Considerations
+
+1. **Database Compatibility**: The application uses MySQL in production. The test configuration uses H2 for CI/CD compatibility.
+
+2. **Spring Security**: Using Spring Security 5 method chaining style. Some methods are deprecated but functional.
+
+3. **Hibernate Dialect**: Using MySQL57Dialect which is compatible with MySQL 5.7+ and MySQL 8.x.
+
+## Future Considerations
+
+- Consider upgrading to Spring Boot 3.x with Java 17+ for long-term support
+- Consider migrating to Jakarta EE namespace when upgrading to Spring Boot 3.x
+- Consider using Spring Security 6 lambda DSL when upgrading to Spring Boot 3.x
diff --git a/README.md b/README.md
index 2f49958e..b9099a63 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,13 @@
## End-to-End Bank Application Deployment using DevSecOps on AWS EKS
- This is a multi-tier bank an application written in Java (Springboot).
+## Requirements
+- **Java 11** (JDK 11 or higher) - This application requires Java 11 to build and run
+- **Maven 3.6+** - For building the application
+- **MySQL 5.7+** - For the database
+
+See [MIGRATION_NOTES.md](MIGRATION_NOTES.md) for details on the Java 8 to Java 11 migration.
+

