You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project currently uses Spring Boot 3.4.4 and JDK 21 (LTS). Spring Boot 4.0.0 was released on November 20, 2025 with support for JDK 25 LTS (released September 2025). This issue tracks the upgrade to the latest LTS versions of both Spring Boot and the JDK.
Spring Boot 4.0 moves to Jakarta EE 11. Most imports should remain the same (jakarta.*), but verify:
jakarta.validation - Bean Validation 3.1
jakarta.persistence - JPA 3.2
jakarta.servlet - Servlet 6.1
Deprecated APIs
Review Spring Boot 4.0 migration guide for deprecated APIs:
@MockBean → @MockitoBean (already noted above)
Check for any other deprecations in controller/service layers
Configuration Properties
Review application.properties for any deprecated property keys and update to new names per Spring Boot 4.0 migration guide.
Acceptance Criteria
All Maven builds pass with JDK 25: ./mvnw clean verify
All 32+ unit tests pass without errors or warnings
Test coverage remains at 100% for controller and service layers
Docker image builds successfully with JDK 25 base images
Application runs without errors on Spring Boot 4.0 + JDK 25
GitHub Actions CI pipeline passes
Swagger UI works correctly
Actuator endpoints respond correctly
Documentation updated to reflect Spring Boot 4.0 and JDK 25
No performance regressions (benchmark if needed)
All CRUD endpoints + search endpoint function correctly
Edge Cases & Risks
1. Mockito Agent Loading Warnings
Current behavior (JDK 21):
WARNING: A Java agent has been loaded dynamically
WARNING: Dynamic loading of agents will be disallowed by default in a future release
Risk: JDK 25 may enforce stricter agent loading policies Mitigation:
Follow Spring Boot 4.0 guidance on Mockito configuration
Consider adding Mockito agent to Maven Surefire plugin configuration
Use @MockitoBean instead of @MockBean
2. CLOB Handling in H2
Current: Using CAST(description AS string) in JPQL for H2 CLOB fields Risk: H2 database version bundled with Spring Boot 4.0 may behave differently Mitigation:
Test search endpoint thoroughly
Review H2 version changes in Spring Boot 4.0 release notes
Description
The project currently uses Spring Boot 3.4.4 and JDK 21 (LTS). Spring Boot 4.0.0 was released on November 20, 2025 with support for JDK 25 LTS (released September 2025). This issue tracks the upgrade to the latest LTS versions of both Spring Boot and the JDK.
Current Configuration
Maven POM (
pom.xml):Docker (
Dockerfile):Why Upgrade?
Spring Boot 4.0 Key Features:
org.springframework.boot.test.mock.mockito.MockBeandeprecation (replaced with standard Mockito)JDK 25 LTS Benefits:
Proposed Solution
Perform a coordinated upgrade of Spring Boot and JDK in a single migration:
Migration Checklist
1. Update Spring Boot Version
pom.xml:2. Update Test Annotations
Spring Boot 4.0 deprecates
@MockBeanin favor of standard Mockito@MockitoBean:Before (Spring Boot 3.x):
After (Spring Boot 4.0):
Files to update:
BooksControllerTests.java- Replace@MockBeanwith@MockitoBeanBooksServiceTests.java- Use standard Mockito@Mockand@InjectMocks(no changes needed)3. Update Docker Configuration
Dockerfile:4. Update CI/CD Pipelines
GitHub Actions (
.github/workflows/maven.yml):Azure Pipelines (
azure-pipelines.yml):5. Review Dependency Versions
Check and update versions for Spring Boot 4.0 compatibility:
6. Update Documentation
Files to update:
.github/copilot-instructions.md- Change all JDK 21 / Spring Boot 3.x referencesREADME.md- Update Prerequisites section (JDK 25, Spring Boot 4.0)CONTRIBUTING.md- Update development setup instructionspom.xml- Update<description>if it mentions Spring Boot 3Key sections:
7. Testing Strategy
./mvnw verifydocker compose builddocker compose uphttp://localhost:9000/swagger/index.htmlhttp://localhost:9001/actuator/health./mvnw spring-boot:runBreaking Changes to Address
Jakarta EE 11 Namespace Changes
Spring Boot 4.0 moves to Jakarta EE 11. Most imports should remain the same (
jakarta.*), but verify:jakarta.validation- Bean Validation 3.1jakarta.persistence- JPA 3.2jakarta.servlet- Servlet 6.1Deprecated APIs
Review Spring Boot 4.0 migration guide for deprecated APIs:
@MockBean→@MockitoBean(already noted above)Configuration Properties
Review
application.propertiesfor any deprecated property keys and update to new names per Spring Boot 4.0 migration guide.Acceptance Criteria
./mvnw clean verifyEdge Cases & Risks
1. Mockito Agent Loading Warnings
Current behavior (JDK 21):
Risk: JDK 25 may enforce stricter agent loading policies
Mitigation:
@MockitoBeaninstead of@MockBean2. CLOB Handling in H2
Current: Using
CAST(description AS string)in JPQL for H2 CLOB fieldsRisk: H2 database version bundled with Spring Boot 4.0 may behave differently
Mitigation:
3. Third-Party Dependency Compatibility
Risk: Some dependencies may not yet support Spring Boot 4.0
Mitigation:
4. Docker Image Size
Risk: JDK 25 images may be larger than JDK 21
Mitigation:
Rollback Plan
If Spring Boot 4.0 + JDK 25 causes issues:
pom.xmlto Spring Boot 3.4.4 and JDK 21@MockitoBean→@MockBean)Dockerfiletoeclipse-temurin:21images./mvnw clean packageRollback Trigger Conditions:
Resources
Related Issues
Implementation Order
Since you have no rush to implement #128 (search endpoint is already complete), the recommended order is:
This ensures the codebase is on the latest LTS stack before completing the search endpoint work.
Status: 🟢 Ready to implement - Both Spring Boot 4.0 and JDK 25 LTS are released and stable