-
Notifications
You must be signed in to change notification settings - Fork 13
feature: upgrade to Java 21 / Spring Boot 3.5 + Jakarta EE migration #723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
73ba9e7
41443c3
6e46fc2
ed0bf38
8913208
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Java CI with Gradle | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up JDK 21 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '21' | ||
| distribution: 'temurin' | ||
| - name: Cache Gradle packages | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-gradle- | ||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
| - name: Build with Gradle | ||
| run: ./gradlew clean test |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| plugins { | ||
| id 'org.springframework.boot' version '2.6.3' | ||
| id 'io.spring.dependency-management' version '1.0.11.RELEASE' | ||
| id 'org.springframework.boot' version '3.5.15' | ||
| id 'io.spring.dependency-management' version '1.1.7' | ||
| id 'java' | ||
| id "com.netflix.dgs.codegen" version "5.0.6" | ||
| id "com.diffplug.spotless" version "6.2.1" | ||
| id "com.netflix.dgs.codegen" version "7.0.3" | ||
| id "com.diffplug.spotless" version "6.25.0" | ||
| } | ||
|
|
||
| version = '0.0.1-SNAPSHOT' | ||
| sourceCompatibility = '11' | ||
| targetCompatibility = '11' | ||
| sourceCompatibility = '21' | ||
| targetCompatibility = '21' | ||
|
|
||
| spotless { | ||
| java { | ||
|
|
@@ -24,36 +24,58 @@ repositories { | |
| mavenCentral() | ||
| } | ||
|
|
||
| dependencyManagement { | ||
| dependencies { | ||
| // Override vulnerable versions pinned by transitive BOMs/dependencies: | ||
| // - kotlin-stdlib < 2.1.0: Information Exposure (SNYK-JAVA-ORGJETBRAINSKOTLIN-2393744), | ||
| // pulled in (and pinned to 1.9.25) via the DGS platform BOM / codegen support. | ||
| // - commons-lang3 < 3.18.0: Uncontrolled Recursion (SNYK-JAVA-ORGAPACHECOMMONS-10734078), | ||
| // pulled transitively by rest-assured (test scope). | ||
| dependency 'org.jetbrains.kotlin:kotlin-stdlib:2.1.20' | ||
| dependency 'org.apache.commons:commons-lang3:3.18.0' | ||
| } | ||
| } | ||
|
|
||
| configurations { | ||
| compileOnly { | ||
| extendsFrom annotationProcessor | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation platform('com.netflix.graphql.dgs:graphql-dgs-platform-dependencies:9.2.2') | ||
|
|
||
| implementation 'org.springframework.boot:spring-boot-starter-web' | ||
| implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
| implementation 'org.springframework.boot:spring-boot-starter-hateoas' | ||
| implementation 'org.springframework.boot:spring-boot-starter-security' | ||
| implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2' | ||
| implementation 'com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:4.9.21' | ||
| implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.4' | ||
| implementation 'com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter' | ||
| // Declared directly (also managed below) so the resolved kotlin-stdlib is a | ||
| // patched 2.1.0+ release; the DGS platform BOM otherwise pins 1.9.25, which | ||
| // carries an Information Exposure advisory (SNYK-JAVA-ORGJETBRAINSKOTLIN-2393744). | ||
| implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.1.20' | ||
| implementation 'org.flywaydb:flyway-core' | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Missing Flyway SQLite module causes startup failure with Flyway 11.x The Spring Boot upgrade from 2.6.3 to 3.5.15 pulls Flyway 11.7.2 (confirmed via Was this helpful? React with 👍 or 👎 to provide feedback.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verified empirically — this is not an issue for the Flyway version in play. SQLite support is still bundled in Starting the app fresh (deleted The fresh
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 Flyway SQLite support may require additional module with Flyway 10+ Spring Boot 3.2+ ships Flyway 10+, which modularized database support into separate artifacts. The Was this helpful? React with 👍 or 👎 to provide feedback.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verified empirically — no extra Flyway module is needed for SQLite here. Flyway resolved by Spring Boot 3.5.15's BOM is 11.7.2, and SQLite support is still bundled in GraphQL also serves correctly on the same boot (exercising the SQLite-backed read path):
All 68 tests (in-memory SQLite) pass as well. If a future Flyway 11.10+ bump extracts SQLite into |
||
| implementation 'io.jsonwebtoken:jjwt-api:0.11.2' | ||
| runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.2', | ||
| 'io.jsonwebtoken:jjwt-jackson:0.11.2' | ||
| implementation 'io.jsonwebtoken:jjwt-api:0.11.5' | ||
| runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5', | ||
| 'io.jsonwebtoken:jjwt-jackson:0.11.5' | ||
| implementation 'joda-time:joda-time:2.10.13' | ||
| implementation 'org.xerial:sqlite-jdbc:3.36.0.3' | ||
| implementation 'org.xerial:sqlite-jdbc:3.50.3.0' | ||
|
|
||
| compileOnly 'org.projectlombok:lombok' | ||
| annotationProcessor 'org.projectlombok:lombok' | ||
|
|
||
| testImplementation 'io.rest-assured:rest-assured:4.5.1' | ||
| testImplementation 'io.rest-assured:json-path:4.5.1' | ||
| testImplementation 'io.rest-assured:xml-path:4.5.1' | ||
| testImplementation 'io.rest-assured:spring-mock-mvc:4.5.1' | ||
| // Declared directly (also managed above) so the resolved commons-lang3 is a | ||
| // patched 3.18.0 release; rest-assured otherwise pulls 3.17.0 transitively | ||
| // (Uncontrolled Recursion, SNYK-JAVA-ORGAPACHECOMMONS-10734078). | ||
| testImplementation 'org.apache.commons:commons-lang3:3.18.0' | ||
| testImplementation 'io.rest-assured:rest-assured:5.5.7' | ||
| testImplementation 'io.rest-assured:json-path:5.5.7' | ||
| testImplementation 'io.rest-assured:xml-path:5.5.7' | ||
| testImplementation 'io.rest-assured:spring-mock-mvc:5.5.7' | ||
| testImplementation 'org.springframework.security:spring-security-test' | ||
| testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
| testImplementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter-test:2.2.2' | ||
| testImplementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter-test:3.0.4' | ||
| } | ||
|
|
||
| tasks.named('test') { | ||
|
|
@@ -69,4 +91,5 @@ tasks.named('clean') { | |
| tasks.named('generateJava') { | ||
| schemaPaths = ["${projectDir}/src/main/resources/schema"] // List of directories containing schema files | ||
| packageName = 'io.spring.graphql' // The package name to use to generate sources | ||
| typeMapping = ["PageInfo": "graphql.relay.PageInfo"] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟨 Permissive CORS configuration allows any origin The (Refers to line 71) Was this helpful? React with 👍 or 👎 to provide feedback.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This CORS configuration is pre-existing and unchanged by this PR. On Since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚩 DGS BOM version (9.2.2) vs codegen plugin version (7.0.3) mismatch
The DGS platform BOM is set to
9.2.2(build.gradle:34) while the DGS codegen Gradle plugin is7.0.3(build.gradle:5). These are separate artifacts with independent versioning, but significant version gaps can lead to generated code that doesn't align with the runtime API. The codegen generates types inio.spring.graphql.typesand constants inio.spring.graphql.DgsConstants— if the newer DGS runtime expects different type structures or annotations, there could be subtle incompatibilities. Worth verifying that the generated code compiles and works correctly with DGS 9.2.2.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified — the codegen plugin (
7.0.3) and DGS runtime BOM (9.2.2) are intentionally on independent version lines and are compatible here. The generatedio.spring.graphql.types.*/DgsConstantscompile and run against DGS 9.2.2 / graphql-java 22.3:./gradlew clean testpasses (68 tests) and the app boots and serves GraphQL. The one codegen-behavior difference (DGS codegen 7.x no longer auto-maps schemaPageInfotographql.relay.PageInfo) is handled explicitly viatypeMapping = ["PageInfo": "graphql.relay.PageInfo"]on thegenerateJavatask.