Skip to content

Migrate from Java 11 to Java 17 (Spring Boot 2.x path)#27

Open
devin-ai-integration[bot] wants to merge 3 commits into
masterfrom
devin/1779901665-java17-migration
Open

Migrate from Java 11 to Java 17 (Spring Boot 2.x path)#27
devin-ai-integration[bot] wants to merge 3 commits into
masterfrom
devin/1779901665-java17-migration

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented May 27, 2026

Copy link
Copy Markdown

Summary

Migrates the project from Java 11 to Java 17 while staying on Spring Boot 2.x (no javaxjakarta namespace changes needed).

Changes in build.gradle:

  • sourceCompatibility / targetCompatibility: '11''17'
  • Spring Boot: 2.6.32.7.18 (latest 2.7.x for best Java 17 support)
  • mybatis-spring-boot-starter: 2.2.22.3.2
  • graphql-dgs-spring-boot-starter: 4.9.215.5.1
  • sqlite-jdbc: 3.36.0.33.42.0.1
  • jjwt-*: 0.11.20.11.5
  • joda-time: 2.10.132.12.7
  • rest-assured (all modules): 4.5.15.3.2 (using enforcedPlatform BOM to prevent Spring Boot from downgrading transitive modules)
  • mybatis-spring-boot-starter-test: 2.2.22.3.2
  • Added --add-opens JVM flags for tests (Java 17 strong encapsulation)
  • Upgraded Spotless plugin 6.2.16.25.0 (required for Java 17 module system compatibility with google-java-format)
  • Overrode graphql-java.version to 19.2 (DGS 5.5.1 requires it; Spring Boot 2.7.18 BOM was forcing 18.5)

Changes in .github/workflows/gradle.yml:

  • JDK: 11 (zulu) → 17 (temurin)
  • setup-java: v2v3
  • actions/checkout: v2v4
  • actions/cache: v2v4 (v2 is deprecated and causes CI failures)

Spotless formatting:

  • Applied google-java-format fix to DefaultJwtServiceTest.java (minor formatting change from upgraded formatter)

Review & Testing Checklist for Human

  • Run ./gradlew clean build locally with JDK 17 to confirm all 68 tests pass
  • Verify the application starts with ./gradlew bootRun and responds at http://localhost:8080/tags
  • Spot-check that no javax.* imports were changed (they should all remain as-is since we stay on Spring Boot 2.x)
  • Confirm DGS GraphQL endpoints still work end-to-end (the graphql-java version override from 18.5→19.2 is a key risk area)

Notes

  • This is the lower-risk Option A (Java 17 + Spring Boot 2.x). No javaxjakarta namespace migration is needed.
  • Three additional fixes were required beyond the original spec to get the build passing:
    1. Spotless 6.2.1 → 6.25.0: The old version couldn't access JDK compiler internals under Java 17's module system.
    2. graphql-java.version = '19.2': Spring Boot 2.7.18 manages graphql-java to 18.5, but DGS 5.5.1 requires 19.2.
    3. rest-assured enforcedPlatform BOM: Spring Boot's dependency management was downgrading rest-assured-common and spring-commons to 4.5.1 while the main rest-assured modules were at 5.3.2, causing NoSuchMethodError.
  • The --add-opens flags are a standard workaround for Java 17's strong encapsulation with reflection-heavy libraries.
  • CI action versions were bumped (checkout@v4, cache@v4, setup-java@v3) as cache@v2 is now deprecated and causes immediate CI failure.

Link to Devin session: https://app.devin.ai/sessions/bef4e524d6c74722bb26363cb5f761a6

- Bump sourceCompatibility/targetCompatibility from 11 to 17
- Upgrade Spring Boot from 2.6.3 to 2.7.18
- Update dependency versions for Java 17 compatibility:
  mybatis-spring-boot-starter 2.2.2 → 2.3.2
  graphql-dgs-spring-boot-starter 4.9.21 → 5.5.1
  sqlite-jdbc 3.36.0.3 → 3.42.0.1
  jjwt 0.11.2 → 0.11.5
  joda-time 2.10.13 → 2.12.7
  rest-assured 4.5.1 → 5.3.2
- Add --add-opens JVM flags for tests (Java 17 strong encapsulation)
- Update CI workflow to use JDK 17 (temurin) with setup-java@v3

Co-Authored-By: numair.baseer <numair.baseer@windsurf.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

devin-ai-integration Bot and others added 2 commits May 27, 2026 17:09
Co-Authored-By: numair.baseer <numair.baseer@windsurf.com>
- Upgrade Spotless plugin 6.2.1 → 6.25.0 (supports Java 17 module system)
- Override graphql-java version to 19.2 (DGS 5.5.1 requires it, Spring Boot BOM was forcing 18.5)
- Use rest-assured BOM (enforcedPlatform) to prevent Spring Boot from downgrading transitive rest-assured modules
- Apply spotless formatting fix to DefaultJwtServiceTest.java

Co-Authored-By: numair.baseer <numair.baseer@windsurf.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