Skip to content

Commit 1fbbd48

Browse files
authored
update to SpringBoot 3 and Java 17 (ExpediaGroup#1638)
### 📝 Description SpringBoot v3 requires Java 17. This PR updates target bytecode of ALL `graphql-kotlin` modules to Java 17 and as a result ibrary users will have to use Java 17+ as well. ### 🔗 Related Issues * Resolves ExpediaGroup#1609
1 parent 0540730 commit 1fbbd48

File tree

56 files changed

+127
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+127
-129
lines changed

.github/workflows/build-examples.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
- name: Validate Gradle wrapper
1818
uses: gradle/wrapper-validation-action@v1
1919

20-
- name: Set up Java 11
20+
- name: Set up Java 17
2121
uses: actions/setup-java@v3
2222
with:
23-
java-version: 11
23+
java-version: 17
2424
distribution: 'zulu'
2525

2626
- name: Set up Gradle cache

.github/workflows/build-libraries.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
- name: Validate Gradle wrapper
1515
uses: gradle/wrapper-validation-action@v1
1616

17-
- name: Set up Java 11
17+
- name: Set up Java 17
1818
uses: actions/setup-java@v3
1919
with:
20-
java-version: 11
20+
java-version: 17
2121
distribution: 'zulu'
2222

2323
- name: Set up Gradle cache

.github/workflows/federation-compatibility.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
- name: Validate Gradle wrapper
2121
uses: gradle/wrapper-validation-action@v1
2222

23-
- name: Set up Java 11
23+
- name: Set up Java 17
2424
uses: actions/setup-java@v3
2525
with:
26-
java-version: 11
26+
java-version: 17
2727
distribution: 'zulu'
2828

2929
- name: Set up Gradle cache

.github/workflows/federation-composition.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v3
1616

17-
- name: Set up Java 11
17+
- name: Set up Java 17
1818
uses: actions/setup-java@v3
1919
with:
20-
java-version: 11
20+
java-version: 17
2121
distribution: 'zulu'
2222

2323
- name: Set up Gradle cache

.github/workflows/plugin-it.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- name: Validate Gradle wrapper
1717
uses: gradle/wrapper-validation-action@v1
18-
- name: Set up Java 11
18+
- name: Set up Java 17
1919
uses: actions/setup-java@v3
2020
with:
21-
java-version: 11
21+
java-version: 17
2222
distribution: 'zulu'
2323
- name: Set up Gradle cache
2424
uses: gradle/gradle-build-action@v2
@@ -36,10 +36,10 @@ jobs:
3636
- uses: actions/checkout@v3
3737
- name: Validate Gradle wrapper
3838
uses: gradle/wrapper-validation-action@v1
39-
- name: Set up Java 11
39+
- name: Set up Java 17
4040
uses: actions/setup-java@v3
4141
with:
42-
java-version: 11
42+
java-version: 17
4343
distribution: 'zulu'
4444
- name: Set up Gradle cache
4545
uses: gradle/gradle-build-action@v2

.github/workflows/pr-check-federation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- master
77
paths:
88
- 'generator/graphql-kotlin-federation/**'
9+
- 'integration/federation-compatibility/**'
910

1011
jobs:
1112
federation-compatibility:

.github/workflows/release-code.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515

1616
- uses: gradle/wrapper-validation-action@v1
1717

18-
- name: Set up Java 11
18+
- name: Set up Java 17
1919
uses: actions/setup-java@v3
2020
with:
21-
java-version: 11
21+
java-version: 17
2222
distribution: 'zulu'
2323

2424
- name: Build library with Gradle

buildSrc/src/main/kotlin/com.expediagroup.graphql.conventions.gradle.kts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ plugins {
1919
// see https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
2020
val libs = the<LibrariesForLibs>()
2121
tasks {
22+
kotlin {
23+
jvmToolchain(17)
24+
}
2225
val kotlinJvmVersion: String by project
2326
withType<KotlinCompile> {
2427
kotlinOptions {
28+
// intellij gets confused without it
2529
jvmTarget = kotlinJvmVersion
2630
freeCompilerArgs = listOf("-Xjsr305=strict")
2731
}
@@ -53,12 +57,6 @@ tasks {
5357
// NOTE: in order to run gradle and maven plugin integration tests we need to have our build artifacts available in local repo
5458
finalizedBy("publishToMavenLocal")
5559
}
56-
java {
57-
// even though we don't have any Java code, since we are building using Java LTS version,
58-
// this is required for Gradle to set the correct JVM versions in the module metadata
59-
targetCompatibility = JavaVersion.VERSION_1_8
60-
sourceCompatibility = JavaVersion.VERSION_1_8
61-
}
6260

6361
// published sources and javadoc artifacts
6462
val jarComponent = project.components.getByName("java")

examples/buildSrc/src/main/kotlin/com.expediagroup.graphql.examples.conventions.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ dependencies {
2727
testImplementation(libs.junit.engine)
2828
}
2929

30-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
30+
tasks.withType<KotlinCompile> {
3131
kotlinOptions {
32-
jvmTarget = "1.8"
32+
jvmTarget = "17"
3333
freeCompilerArgs = listOf("-Xjsr305=strict")
3434
}
3535
}
@@ -39,6 +39,9 @@ tasks {
3939
toolVersion = libs.versions.detekt.get()
4040
config = files(File(rootDir.parent, "detekt.yml").absolutePath)
4141
}
42+
kotlin {
43+
jvmToolchain(17)
44+
}
4245
ktlint {
4346
version.set(libs.versions.ktlint.core.get())
4447
}

examples/server/spring-server/src/main/kotlin/com/expediagroup/graphql/examples/server/spring/exceptions/ValidationException.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 Expedia, Inc
2+
* Copyright 2023 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
1616

1717
package com.expediagroup.graphql.examples.server.spring.exceptions
1818

19-
import javax.validation.ConstraintViolation
19+
import jakarta.validation.ConstraintViolation
2020

2121
class ValidationException(val constraintErrors: List<ConstraintError>) : RuntimeException("Validation error")
2222

examples/server/spring-server/src/main/kotlin/com/expediagroup/graphql/examples/server/spring/query/ValidatedQuery.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 Expedia, Inc
2+
* Copyright 2023 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@ package com.expediagroup.graphql.examples.server.spring.query
1919
import com.expediagroup.graphql.server.operations.Query
2020
import org.springframework.stereotype.Component
2121
import org.springframework.validation.annotation.Validated
22-
import javax.validation.Valid
23-
import javax.validation.constraints.Pattern
22+
import jakarta.validation.Valid
23+
import jakarta.validation.constraints.Pattern
2424

2525
@Validated
2626
@Component

examples/server/spring-server/src/test/kotlin/com/expediagroup/graphql/examples/server/spring/subscriptions/SimpleSubscriptionIT.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 Expedia, Inc
2+
* Copyright 2023 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.TestInstance
3131
import org.junit.jupiter.api.TestMethodOrder
3232
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
3333
import org.springframework.boot.test.context.SpringBootTest
34-
import org.springframework.boot.web.server.LocalServerPort
34+
import org.springframework.boot.test.web.server.LocalServerPort
3535
import org.springframework.web.reactive.socket.WebSocketSession
3636
import org.springframework.web.reactive.socket.client.ReactorNettyWebSocketClient
3737
import reactor.core.publisher.Flux

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ systemProp.org.gradle.internal.publish.checksums.insecure=true
1313
# See: https://github.com/gradle/gradle/issues/8139
1414
org.gradle.jvmargs=-Xmx2g -XX:+HeapDumpOnOutOfMemoryError
1515

16-
kotlinJvmVersion = 1.8
16+
kotlinJvmVersion = 17

gradle/libs.versions.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[versions]
2-
android-plugin = "7.1.2"
2+
android-plugin = "8.0.0-alpha11"
33
classgraph = "4.8.149"
44
dataloader = "3.2.0"
55
federation = "2.2.0"
66
graphql-java = "19.2"
7-
jackson = "2.13.3"
7+
jackson = "2.14.1"
88
kotlin = "1.7.21"
99
kotlinx-benchmark = "0.4.4"
1010
kotlinx-coroutines = "1.6.4"
@@ -15,21 +15,21 @@ maven-plugin-api = "3.6.3"
1515
maven-project = "2.2.1"
1616
poet = "1.12.0"
1717
## reactorVersion should be the same reactor-core version pulled from spring-boot-starter-webflux
18-
reactor-core = "3.4.26"
19-
reactor-extensions = "1.1.9"
18+
reactor-core = "3.5.1"
19+
reactor-extensions = "1.2.1"
2020
slf4j = "1.7.36"
21-
spring = "5.3.24"
22-
spring-boot = "2.7.7"
21+
spring = "6.0.3"
22+
spring-boot = "3.0.1"
2323

2424
# test dependencies
2525
# kotlin-compile-testing has to be using the same kotlin version as the kotlinx-serialization compiler
2626
# https://github.com/tschuchortdev/kotlin-compile-testing the latest version targets kotlin 1.7.10 which blocks updates to newer
2727
# versions of kotlin, switching to a fork https://github.com/ZacSweers/kotlin-compile-testing
2828
compile-testing = "0.1.0"
2929
icu = "71.1"
30-
junit = "5.8.2"
30+
junit = "5.9.1"
3131
logback = "1.2.1"
32-
mockk = "1.12.5"
32+
mockk = "1.13.3"
3333
rxjava = "3.1.5"
3434
wiremock = "2.33.2"
3535

@@ -40,7 +40,7 @@ jacoco = "0.8.8"
4040
# klint gradle plugin breaks with 0.46.x+
4141
ktlint-core = "0.45.2"
4242
ktlint-plugin = "10.3.0"
43-
maven-plugin-development = "0.4.0"
43+
maven-plugin-development = "0.4.1"
4444
nexus-publish-plugin = "1.1.0"
4545
plugin-publish = "0.21.0"
4646

integration/federation-compatibility/build.gradle.kts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ plugins {
1010
}
1111

1212
group = "com.expediagroup.federation.compatibility"
13-
java.sourceCompatibility = JavaVersion.VERSION_11
1413

1514
repositories {
1615
mavenCentral()
@@ -28,15 +27,19 @@ dependencies {
2827
graphqlSDL("com.expediagroup", "graphql-kotlin-federated-hooks-provider")
2928
}
3029

31-
tasks.withType<KotlinCompile> {
32-
kotlinOptions {
33-
freeCompilerArgs = listOf("-Xjsr305=strict")
34-
jvmTarget = "11"
35-
}
36-
}
37-
38-
tasks.withType<Test> {
39-
useJUnitPlatform()
30+
tasks {
31+
kotlin {
32+
jvmToolchain(17)
33+
}
34+
withType<KotlinCompile> {
35+
kotlinOptions {
36+
jvmTarget = "17"
37+
freeCompilerArgs = listOf("-Xjsr305=strict")
38+
}
39+
}
40+
withType<Test> {
41+
useJUnitPlatform()
42+
}
4043
}
4144

4245
graphql {

integration/gradle-plugin-android-test/app/build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ plugins {
88
android {
99
compileSdk = 30
1010
compileOptions {
11-
sourceCompatibility = JavaVersion.VERSION_1_8
12-
targetCompatibility = JavaVersion.VERSION_1_8
11+
sourceCompatibility = JavaVersion.VERSION_17
12+
targetCompatibility = JavaVersion.VERSION_17
1313
}
1414
kotlinOptions {
15-
jvmTarget = "1.8"
15+
jvmTarget = "17"
1616
}
17+
namespace = "com.expediagroup.graphqlkotlin"
1718
}
1819

1920
dependencies {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.expediagroup.graphqlkotlin">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
33

44
</manifest>
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

integration/gradle-plugin-android-test/gradlew

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac

integration/gradle-plugin-android-test/gradlew.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
2828
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

integration/gradle-plugin-integration-tests/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ tasks {
7575
}
7676

7777
for (projectName in listOf(":download-sdl-groovy-it", ":download-sdl-kotlin-it")) {
78-
project("$projectName") {
78+
project(projectName) {
7979
ext.set("wireMockServerPort", extension.port)
8080

8181
project.afterEvaluate {
@@ -88,7 +88,7 @@ for (projectName in listOf(":download-sdl-groovy-it", ":download-sdl-kotlin-it")
8888
}
8989

9090
for (projectName in listOf(":introspection-groovy-it", ":introspection-kotlin-it")) {
91-
project("$projectName") {
91+
project(projectName) {
9292
ext.set("wireMockServerPort", extension.port)
9393

9494
project.afterEvaluate {

0 commit comments

Comments
 (0)