Skip to content

Commit 62d62c2

Browse files
committed
update to SpringBoot 3 and Java 17
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.
1 parent 549ba89 commit 62d62c2

File tree

16 files changed

+51
-44
lines changed

16 files changed

+51
-44
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/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: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ plugins {
1919
// see https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
2020
val libs = the<LibrariesForLibs>()
2121
tasks {
22-
val kotlinJvmVersion: String by project
22+
kotlin {
23+
jvmToolchain(17)
24+
}
2325
withType<KotlinCompile> {
2426
kotlinOptions {
25-
jvmTarget = kotlinJvmVersion
2627
freeCompilerArgs = listOf("-Xjsr305=strict")
2728
}
2829
}
@@ -53,12 +54,6 @@ tasks {
5354
// NOTE: in order to run gradle and maven plugin integration tests we need to have our build artifacts available in local repo
5455
finalizedBy("publishToMavenLocal")
5556
}
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-
}
6257

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

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: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ 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,20 +15,20 @@ 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"
31-
mockk = "1.12.5"
30+
junit = "5.9.1"
31+
mockk = "1.13.3"
3232
mustache = "0.9.10"
3333
rxjava = "3.1.5"
3434
wiremock = "2.33.2"
@@ -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: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ plugins {
2121
}
2222

2323
group = "com.expediagroup.federation.compatibility"
24-
java.sourceCompatibility = JavaVersion.VERSION_11
2524

2625
repositories {
2726
mavenCentral()
@@ -39,15 +38,18 @@ dependencies {
3938
graphqlSDL("com.expediagroup", "graphql-kotlin-federated-hooks-provider")
4039
}
4140

42-
tasks.withType<KotlinCompile> {
43-
kotlinOptions {
44-
freeCompilerArgs = listOf("-Xjsr305=strict")
45-
jvmTarget = "11"
46-
}
47-
}
48-
49-
tasks.withType<Test> {
50-
useJUnitPlatform()
41+
tasks {
42+
kotlin {
43+
jvmToolchain(17)
44+
}
45+
withType<KotlinCompile> {
46+
kotlinOptions {
47+
freeCompilerArgs = listOf("-Xjsr305=strict")
48+
}
49+
}
50+
withType<Test> {
51+
useJUnitPlatform()
52+
}
5153
}
5254

5355
graphql {

plugins/graphql-kotlin-maven-plugin/build.gradle.kts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,29 @@ import java.time.Duration
44
description = "GraphQL Kotlin Maven Plugin that can generate type-safe GraphQL Kotlin client and GraphQL schema in SDL format using reflections"
55

66
buildscript {
7+
repositories {
8+
mavenCentral()
9+
mavenLocal {
10+
content {
11+
includeGroup("de.benediktritter")
12+
}
13+
}
14+
}
15+
716
dependencies {
817
classpath(libs.wiremock.standalone)
18+
classpath("de.benediktritter:plugin:99.99.99")
919
}
1020
}
1121

1222
@Suppress("DSL_SCOPE_VIOLATION") // TODO: remove once KTIJ-19369 / Gradle#22797 is fixed
1323
plugins {
1424
id("com.expediagroup.graphql.conventions")
15-
alias(libs.plugins.maven.plugin.development)
25+
// alias(libs.plugins.maven.plugin.development)
1626
}
1727

28+
apply(plugin = "de.benediktritter.maven-plugin-development")
29+
1830
dependencies {
1931
api(projects.graphqlKotlinClientGenerator)
2032
api(projects.graphqlKotlinSdlGenerator)

servers/graphql-kotlin-spring-server/src/main/kotlin/com/expediagroup/graphql/server/spring/GraphQLConfigurationProperties.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717
package com.expediagroup.graphql.server.spring
1818

1919
import org.springframework.boot.context.properties.ConfigurationProperties
20-
import org.springframework.boot.context.properties.ConstructorBinding
2120

2221
/**
2322
* [ConfigurationProperties] bean that defines supported GraphQL configuration options.
2423
*/
25-
@ConstructorBinding
2624
@ConfigurationProperties("graphql")
2725
data class GraphQLConfigurationProperties(
2826
/** GraphQL server endpoint, defaults to 'graphql' */

servers/graphql-kotlin-spring-server/src/main/kotlin/com/expediagroup/graphql/server/spring/execution/SpringGraphQLRequestParser.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ open class SpringGraphQLRequestParser(
4242

4343
override suspend fun parseRequest(request: ServerRequest): GraphQLServerRequest? = when {
4444
request.queryParam(REQUEST_PARAM_QUERY).isPresent -> { getRequestFromGet(request) }
45-
request.method() == HttpMethod.POST -> { getRequestFromPost(request) }
45+
request.method().equals(HttpMethod.POST) -> { getRequestFromPost(request) }
4646
else -> null
4747
}
4848

servers/graphql-kotlin-spring-server/src/main/resources/META-INF/spring.factories

Lines changed: 0 additions & 1 deletion
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
com.expediagroup.graphql.server.spring.GraphQLAutoConfiguration

servers/graphql-kotlin-spring-server/src/test/kotlin/com/expediagroup/graphql/server/spring/routes/SubscriptionRoutesConfigurationIT.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test
3030
import org.springframework.beans.factory.annotation.Autowired
3131
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
3232
import org.springframework.boot.test.context.SpringBootTest
33-
import org.springframework.boot.web.server.LocalServerPort
33+
import org.springframework.boot.test.web.server.LocalServerPort
3434
import org.springframework.context.annotation.Bean
3535
import org.springframework.context.annotation.Configuration
3636
import org.springframework.http.MediaType

servers/graphql-kotlin-spring-server/src/test/kotlin/com/expediagroup/graphql/server/spring/subscriptions/SubscriptionWebSocketHandlerIT.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import graphql.schema.DataFetchingEnvironment
2929
import org.junit.jupiter.api.Test
3030
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
3131
import org.springframework.boot.test.context.SpringBootTest
32-
import org.springframework.boot.web.server.LocalServerPort
32+
import org.springframework.boot.test.web.server.LocalServerPort
3333
import org.springframework.context.annotation.Bean
3434
import org.springframework.context.annotation.Configuration
3535
import org.springframework.http.HttpHeaders

0 commit comments

Comments
 (0)