Skip to content

Java 21 Upgrade Attempt: Configuration Updates and Compatibility Analysis (AT-61)#12

Open
devin-ai-integration[bot] wants to merge 3 commits into
masterfrom
devin/AT-61-1755475549-java-21-upgrade
Open

Java 21 Upgrade Attempt: Configuration Updates and Compatibility Analysis (AT-61)#12
devin-ai-integration[bot] wants to merge 3 commits into
masterfrom
devin/AT-61-1755475549-java-21-upgrade

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 18, 2025

Copy link
Copy Markdown

Java 21 Upgrade Attempt: Configuration Updates and Compatibility Analysis (AT-61)

Summary

This PR represents an exploratory attempt to upgrade the Spring Boot RealWorld Example App from Java 11 to Java 21, as requested in ticket AT-61. Critical compatibility issues were discovered that prevent a complete Java 21 upgrade with the current Spring Boot 2.6.3 version.

What was accomplished:

  • ✅ Updated GitHub Actions workflows to use Java 17 (.github/workflows/gradle.yml and new build.yml)
  • ✅ Upgraded Spotless plugin from 6.2.1 to 7.2.1 for better Java compatibility
  • ✅ Updated Gradle wrapper from 7.4 to 7.6.4 (latest compatible with Spring Boot 2.6.3)
  • ✅ Applied code formatting fixes via Spotless
  • ✅ Updated README.md to reference Java 21 requirement
  • ✅ Comprehensive compatibility analysis documented

Critical Discovery - Java 21 Upgrade Impossible:

An impossible compatibility triangle was discovered that prevents Java 21 upgrade:

  1. Spring Boot 2.6.3 only supports Gradle 7.x
  2. Gradle 7.6.4 cannot run on Java 21 (unsupported class file major version 65)
  3. Gradle 8.4+ is required for Java 21 support

Result: Maximum achievable upgrade with current Spring Boot version is Java 17. Full Java 21 upgrade requires Spring Boot 3.2+ (major breaking change beyond current scope).

Review & Testing Checklist for Human

⚠️ CRITICAL INCONSISTENCY: README.md claims Java 21 requirement but workflows use Java 17

  • Verify application runs correctly with ./gradlew bootRun and test core functionality at http://localhost:8080/tags
  • Resolve documentation inconsistency: Decide whether README should reference Java 17 or Java 21 based on business requirements
  • Test Spotless formatting by running ./gradlew spotlessCheck to ensure no formatting regressions
  • Validate Gradle upgrade by testing build in clean environment to catch any wrapper-related issues
  • Review business requirements: Determine if partial Java 17 upgrade meets AT-61 objectives or if Spring Boot 3.x upgrade is needed

Diagram

%%{ init : { "theme" : "default" }}%%
graph TD
    README["README.md<br/>(Java 21 docs)"]:::major-edit
    BuildYml[".github/workflows/<br/>build.yml<br/>(NEW - Java 17)"]:::major-edit
    GradleYml[".github/workflows/<br/>gradle.yml<br/>(Java 17)"]:::major-edit
    BuildGradle["build.gradle<br/>(Spotless 7.2.1,<br/>Java 17 target)"]:::major-edit
    GradleWrapper["gradle/wrapper/<br/>gradle-wrapper.properties<br/>(Gradle 7.6.4)"]:::major-edit
    TestFile["DefaultJwtServiceTest.java<br/>(formatting fix)"]:::minor-edit
    SpringBoot["Spring Boot 2.6.3<br/>(unchanged)"]:::context
    
    SpringBoot --> BuildGradle
    BuildGradle --> GradleWrapper
    GradleWrapper --> BuildYml
    GradleWrapper --> GradleYml
    BuildGradle --> TestFile
    
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit
        L3[Context/No Edit]:::context
    end

classDef major-edit fill:#90EE90
classDef minor-edit fill:#87CEEB
classDef context fill:#FFFFFF
Loading

Notes

  • Session Details: Requested by Shawn Azman (@ShawnAzman) - Devin Session
  • Ticket: AT-61 - Core Build System and Java Runtime Upgrade
  • Repository: COG-GTM/spring-boot-realworld-example-app (forked repo)
  • Recommendation: For full Java 21 support, consider upgrading to Spring Boot 3.2+ in a separate initiative, as it requires Java 17+ baseline and may introduce breaking changes
  • CI Status: ✅ All checks passing with Java 17 configuration

…lity issues

- Update GitHub Actions workflows to use Java 21 with Zulu distribution
- Create new build.yml workflow for Java 21 CI
- Update README.md to reference Java 21 requirement
- Upgrade Spotless plugin from 6.2.1 to 7.2.1 for Java 21 compatibility
- Update Gradle wrapper to 7.6.4 (latest compatible with Spring Boot 2.6.3)
- Set compilation target to Java 17 due to compatibility constraints

COMPATIBILITY ISSUES DISCOVERED:
- Spring Boot 2.6.3 only supports Gradle 7.x, not Gradle 8.x
- Gradle 7.6.4 cannot run on Java 21 (major version 65 unsupported)
- Gradle 8.4+ required for Java 21 support creates impossible compatibility triangle
- Full Java 21 upgrade requires Spring Boot 3.2+ which needs Java 17+ baseline

Ticket: AT-61
Co-Authored-By: Shawn Azman <shawn.d.azman@gmail.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 August 18, 2025 00:15
- Update GitHub Actions workflows to use Java 17 instead of Java 21
- Change build.yml workflow name to indicate Java 21 upgrade is blocked
- Apply Spotless formatting fixes to DefaultJwtServiceTest.java
- Resolves 'Unsupported class file major version 65' error in CI

COMPATIBILITY ANALYSIS:
- Java 21 upgrade blocked by impossible compatibility triangle:
  * Spring Boot 2.6.3 only supports Gradle 7.x
  * Gradle 7.6.4 cannot run on Java 21 (major version 65 unsupported)
  * Gradle 8.4+ required for Java 21 support
- Maximum achievable upgrade: Java 17 with current Spring Boot version
- Full Java 21 upgrade requires Spring Boot 3.2+ (major breaking change)

Ticket: AT-61
Co-Authored-By: Shawn Azman <shawn.d.azman@gmail.com>
- Change README.md from Java 21 to Java 17 requirement
- Resolves inconsistency between documentation and CI workflows
- Aligns with maximum achievable upgrade given compatibility constraints

Ticket: AT-61
Co-Authored-By: Shawn Azman <shawn.d.azman@gmail.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