Skip to content

Commit 1fbbd48

Browse files
authored
update to SpringBoot 3 and Java 17 (#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 #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

0 commit comments

Comments
 (0)