Migrate from Java 11 to Java 21 with Spring Boot 3.5.6 #75
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.5.6
Summary
Complete migration of the Spring Boot RealWorld Example Application from Java 11 + Spring Boot 2.6.3 to Java 21 + Spring Boot 3.5.6. This is a major upgrade that includes:
javax.*imports →jakarta.*(23+ files affected)WebSecurityConfigurerAdapter→SecurityFilterChainbean approachgraphql-dgs-spring-boot-starter→graphql-dgs-spring-graphql-starter)All tests pass locally (70/70) and CI checks pass ✅
Review & Testing Checklist for Human
Test GraphQL API endpoints with real clients, especially paginated queries (articles feed, comments). The PageInfo type changed from
graphql.relay.DefaultPageInfoto generatedio.spring.graphql.types.PageInfo, which could break existing clients if they rely on the response structure.Verify JWT authentication flows: Test login, token generation, and protected endpoints. JJWT 0.13.0 has breaking API changes:
parserBuilder().setSigningKey()toparser().verifyWith()Test error handling: Verify that REST API and GraphQL error responses maintain the expected format for clients. Both
CustomizeExceptionHandlerandGraphQLCustomizeExceptionHandlerwere modified, and the GraphQL handler now uses async API (CompletableFuture).Security configuration review: Validate that all endpoints have correct authentication requirements:
/graphiqland/graphqlshould be public/articles/feed(GET) requires authentication/usersand/users/login(POST) should be publicTest Plan Recommendation
/graphiqlNotes
@MockBeanannotations marked for removal in future Java versions. This doesn't affect functionality now but will need addressing in a future migration.graphql-dgs-spring-boot-startertographql-dgs-spring-graphql-starter. Make sure any documentation or deployment scripts are updated.WebSecurityConfigurerAdapterpattern to component-basedSecurityFilterChainbean. Logic should be equivalent but worth double-checking security behavior.Link to Devin run: https://app.devin.ai/sessions/51ca1f399821411bb7547217f2f98ad7
Requested by: Abhay Aggarwal (@abhay-codeium)