Skip to content

Migrate Spring Boot application from Java 11 to Java 17#12

Open
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1764009485-java-17-migration
Open

Migrate Spring Boot application from Java 11 to Java 17#12
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1764009485-java-17-migration

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 24, 2025

Copy link
Copy Markdown

Migrate Spring Boot application from Java 11 to Java 17

Summary

This PR migrates the Spring Boot application from Java 11 to Java 17, which includes upgrading Spring Boot from version 2.6.3 to 3.2.0 and updating all related dependencies. This is a comprehensive migration involving configuration changes, dependency updates, and source code modifications.

Key Changes

Framework & Build Tool Upgrades:

  • Java: 11 → 17
  • Spring Boot: 2.6.3 → 3.2.0
  • Gradle: 7.4 → 8.5
  • Spring Dependency Management: 1.0.11.RELEASE → 1.1.4

Dependency Updates:

  • MyBatis: 2.2.2 → 3.0.3
  • Netflix DGS GraphQL: 4.9.21 → 9.1.2
  • DGS Codegen: 5.0.6 → 6.2.1
  • JWT (jjwt): 0.11.2 → 0.12.6
  • SQLite JDBC: 3.36.0.3 → 3.46.1.3
  • rest-assured: 4.5.1 → 5.3.2
  • Spotless: 6.2.1 → 6.23.3

Source Code Migrations:

  • Jakarta EE namespace migration: All javax.* imports changed to jakarta.* (except javax.crypto which is JCE)
  • Joda-Time to java.time: Complete migration from Joda-Time DateTime to java.time.Instant throughout the codebase
  • Spring Security: Updated from deprecated WebSecurityConfigurerAdapter to SecurityFilterChain bean pattern
  • JWT library API: Updated for jjwt 0.12.x API changes (setSubjectsubject, parseClaimsJwsparseSignedClaims, etc.)
  • DGS GraphQL: Updated exception handler to return CompletableFuture for DGS 9.x compatibility
  • MyBatis type handlers: Updated to handle Instant instead of DateTime
  • Jackson serialization: Updated to serialize Instant using DateTimeFormatter.ISO_INSTANT

CI/CD Updates:

  • Updated GitHub Actions workflow to use Java 17
  • Fixed deprecated actions/cache@v2actions/cache@v4

Testing

  • ✅ All 69 tests passing locally with Java 17
  • ✅ Application starts successfully and responds to requests (tested /tags endpoint)
  • ✅ Spotless code formatting applied
  • ⏳ CI checks pending verification after actions/cache fix

Review & Testing Checklist for Human

This is a high-risk migration involving major framework upgrades and API changes. Please thoroughly test the following:

  • Authentication & JWT: Test user registration, login, and JWT token generation/validation. Verify tokens work correctly and expire as expected.
  • Date/Time handling: Test article creation, comment timestamps, and any date-based queries. Verify timezone handling is correct (should be UTC).
  • GraphQL endpoints: Test all GraphQL queries and mutations, especially error handling scenarios.
  • REST API endpoints: Test all REST endpoints including articles, comments, users, profiles, tags, and favorites.
  • CI pipeline: Verify that CI passes with the updated actions/cache@v4 and all tests pass in the CI environment.
  • Database operations: Verify MyBatis queries work correctly with the new Instant type handler.

Recommended Test Plan

  1. Start the application locally with Java 17: ./gradlew bootRun
  2. Test user registration and login flows
  3. Create articles with tags, update them, delete them
  4. Add and remove comments on articles
  5. Test favoriting/unfavoriting articles
  6. Test following/unfollowing users
  7. Test GraphQL queries via GraphiQL interface at /graphiql
  8. Verify all timestamps display correctly in API responses

Notes

  • The application was tested locally and successfully started with Java 17 and Spring Boot 3.2.0
  • The /tags endpoint was verified to return correct responses
  • All source code changes follow existing code conventions and patterns
  • No breaking changes to the API contract - all endpoints remain the same
  • The migration removes the Joda-Time dependency entirely in favor of java.time

Devin Session: https://app.devin.ai/sessions/d6520948c7944674a82d9cd383e3602d
Requested by: Numair Baseer (numair.baseer@codeium.com) / @numairb97

- Update Java version to 17 in build.gradle, CI/CD pipeline, and README
- Upgrade Spring Boot from 2.6.3 to 3.2.0
- Update Gradle wrapper from 7.4 to 8.5 for Java 17 support
- Update all dependencies for Spring Boot 3.x compatibility:
  - MyBatis: 2.2.2 → 3.0.3
  - Netflix DGS GraphQL: 4.9.21 → 9.1.2
  - DGS Codegen: 5.0.6 → 6.2.1
  - JWT libraries: 0.11.2 → 0.12.6
  - SQLite JDBC: 3.36.0.3 → 3.46.1.3
  - Spotless: 6.2.1 → 6.23.3
  - rest-assured: 4.5.1 → 5.3.2
- Replace all javax.* imports with jakarta.* (Jakarta EE namespace)
- Migrate from Joda-Time to java.time API throughout codebase
- Update Spring Security configuration for Spring Boot 3.x API
- Update JWT service for jjwt 0.12.x API changes
- Update GraphQL exception handlers for DGS 9.x API changes
- Fix PageInfo type conversions for DGS framework
- Add Groovy dependency resolution strategy
- Update test files to use java.time API
- Fix JWT test key length for HS512 algorithm requirements

All tests passing (69 tests)

Co-Authored-By: Numair Baseer <numair.baseer@codeium.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

The v2 version of actions/cache has been deprecated and causes CI failures.
Updated to v4 to resolve the deprecation warning and allow CI to pass.

Co-Authored-By: Numair Baseer <numair.baseer@codeium.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants