Skip to content

Conversation

@devin-ai-integration
Copy link

@devin-ai-integration devin-ai-integration bot commented Oct 15, 2025

Migrate from Java 11 to Java 17

Summary

This PR migrates the Spring Boot RealWorld example application from Java 11 to Java 17 (LTS). The changes include:

  • Build configuration: Updated sourceCompatibility and targetCompatibility to Java 17 in build.gradle
  • CI/CD pipeline: Updated GitHub Actions workflow to use JDK 17 and upgraded actions/cache from v2 to v4 (v2 was deprecated)
  • Tooling: Upgraded Spotless plugin from 6.2.1 to 6.13.0 for Java 17 compatibility (older version's Google Java Format doesn't work with Java 17's module system)
  • Documentation: Updated README.md to reflect Java 17 requirement
  • Code formatting: Applied updated Google Java Format rules (one test file reformatted)

All 68 unit tests pass locally and in CI with Java 17. Spring Boot 2.6.3 officially supports Java 17, and all dependencies (MyBatis 2.2.2, Netflix DGS 4.9.21, JJWT 0.11.2, SQLite JDBC 3.36.0.3) are compatible.

Review & Testing Checklist for Human

  • Test the application end-to-end with Java 17 - CI only runs unit tests; verify the app works correctly in a real Java 17 environment (e.g., ./gradlew bootRun and test API endpoints)
  • Verify deployment environments have Java 17 available - Check staging/production environments and update if needed to prevent deployment failures
  • Review any Java 11-specific workarounds or configurations - Check if there are any production configs, JVM flags, or code workarounds that were Java 11-specific and might need updating

Recommended Test Plan

  1. Run the application locally with Java 17: ./gradlew bootRun
  2. Test the REST API endpoints: curl http://localhost:8080/tags
  3. Test the GraphQL endpoint at http://localhost:8080/graphql
  4. Run full test suite: ./gradlew clean test
  5. Verify formatting still works: ./gradlew spotlessCheck

Notes

  • No javax.* to jakarta.* migration required (only needed for Spring Boot 3.x)
  • Java 17 has stricter module system enforcement and different default GC settings than Java 11, which could surface subtle behavioral differences in production
  • The Spotless plugin upgrade was necessary because the old version's Google Java Format cannot access Java compiler internals in Java 17

Link to Devin run: https://app.devin.ai/sessions/3e26d95ce8bf4a73bb0fef06ecae3889
Requested by: Ibs (@ibrahim-sowunmi)

- Update sourceCompatibility and targetCompatibility to '17' in build.gradle
- Update GitHub Actions workflow to use JDK 17
- Update README.md to specify Java 17 requirement
- Upgrade Spotless plugin from 6.2.1 to 6.13.0 for Java 17 compatibility
- Apply code formatting changes per updated Google Java Format

All tests pass successfully with Java 17 (68 tests).
@devin-ai-integration
Copy link
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

GitHub has deprecated actions/cache v1 and v2. Updated to v4 to resolve CI failure.
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.

1 participant