Migrate from Java 11 to Java 21 with Spring Boot 3.2.0 #77
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Migrate from Java 11 to Java 21 with Spring Boot 3.2.0
Summary
This PR upgrades the application from Java 11 to Java 21 and Spring Boot 2.6.3 to 3.2.0. This major version upgrade required:
Build Configuration Updates: Updated Java compatibility to 21, Spring Boot to 3.2.0, and upgraded all major dependencies:
Jakarta EE Namespace Migration (30 files): Replaced all
javax.validation.*andjavax.servlet.*imports withjakarta.*equivalents as required by Spring Boot 3.x.Joda-Time → java.time Migration (16 files): Removed joda-time dependency and migrated all
DateTimeusage tojava.time.Instant:DateTimeHandlerto handleInstantwithTimestampconversionDateTimeFormatter.ISO_INSTANTArticle,Comment) and testsSpring Security 6.x Refactoring:
WebSecurityConfigurerAdapterSecurityFilterChainbean pattern with lambda DSLantMatchers()→requestMatchers()CI/CD Updates: Updated GitHub Actions workflow to use JDK 21
Documentation: Updated README to require Java 21
Review & Testing Checklist for Human
Run full test suite - Verify all tests pass, especially:
Verify API date formatting - Test a few API endpoints manually to ensure dates are serialized correctly in ISO-8601 format (should match previous format exactly)
Test authentication flows - Verify the Spring Security refactoring didn't change authorization behavior:
/users,/users/login,/articles/**,/profiles/**,/tags)/articles/feed)/graphql,/graphiql)Check MyBatis timestamp handling - Verify that existing database records with timestamps are loaded correctly after the DateTime → Instant migration
Review DGS plugin compatibility - The codegen plugin version 8.1.1 might have compatibility issues with DGS runtime 8.2.0. Check CI logs for any GraphQL code generation warnings/errors.
Test Plan
Notes
javax.crypto.*imports inDefaultJwtService.javaare intentionally NOT migrated - they're part of Java's core JCA, not Jakarta EELink to Devin run: https://app.devin.ai/sessions/fdf009aee545456b9e3b5f7d32d7992e
Requested by: milind-cognition (@milind-cognition)