Skip to content

Commit 7edb0b3

Browse files
committed
Upgrade the build to Java 25
See gh-35531 Closes gh-35530
1 parent aa272b4 commit 7edb0b3

File tree

9 files changed

+24
-11
lines changed

9 files changed

+24
-11
lines changed

.github/actions/build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ inputs:
1919
java-version:
2020
description: 'Java version to compile and test with'
2121
required: false
22-
default: '24'
22+
default: '25'
2323
publish:
2424
description: 'Whether to publish artifacts ready for deployment to Artifactory'
2525
required: false

.github/actions/prepare-gradle-build/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ inputs:
1919
java-version:
2020
description: 'Java version to use for the build'
2121
required: false
22-
default: '24'
22+
default: '25'
2323
runs:
2424
using: composite
2525
steps:
@@ -30,7 +30,7 @@ runs:
3030
java-version: |
3131
${{ inputs.java-early-access == 'true' && format('{0}-ea', inputs.java-version) || inputs.java-version }}
3232
${{ inputs.java-toolchain == 'true' && '17' || '' }}
33-
24
33+
25
3434
- name: Set Up Gradle
3535
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
3636
with:

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
toolchain: false
2121
- version: 21
2222
toolchain: true
23-
- version: 24
23+
- version: 25
2424
toolchain: true
2525
exclude:
2626
- os:

.sdkmanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Enable auto-env through the sdkman_auto_env config
22
# Add key=value pairs of SDKs to use below
3-
java=24.0.2-librca
3+
java=25-librca

buildSrc/src/main/java/org/springframework/build/JavaConventions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class JavaConventions {
4545
* <p>NOTE: If you update this value, you should also update the value used in
4646
* the {@code javadoc} task in {@code framework-api.gradle}.
4747
*/
48-
private static final JavaLanguageVersion DEFAULT_LANGUAGE_VERSION = JavaLanguageVersion.of(24);
48+
private static final JavaLanguageVersion DEFAULT_LANGUAGE_VERSION = JavaLanguageVersion.of(25);
4949

5050
/**
5151
* The Java version we should use as the baseline for the compiled bytecode

framework-api/framework-api.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies {
2222

2323
javadoc {
2424
javadocTool.set(javaToolchains.javadocToolFor({
25-
languageVersion = JavaLanguageVersion.of(24)
25+
languageVersion = JavaLanguageVersion.of(25)
2626
}))
2727

2828
title = "${rootProject.description} ${version} API"

framework-docs/framework-docs.gradle

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
12
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
23

34
plugins {
@@ -43,10 +44,14 @@ repositories {
4344
}
4445
}
4546

46-
// To avoid a redeclaration error with Kotlin compiler
47-
tasks.named('compileKotlin', KotlinCompilationTask.class) {
47+
// To avoid a redeclaration error with Kotlin compiler and set the JVM target
48+
tasks.withType(KotlinCompilationTask.class).configureEach {
4849
javaSources.from = []
49-
compilerOptions.freeCompilerArgs = [ "-Xannotation-default-target=param-property" ] // Upcoming default, see https://youtrack.jetbrains.com/issue/KT-73255
50+
compilerOptions.jvmTarget = JvmTarget.JVM_17
51+
compilerOptions.freeCompilerArgs.addAll(
52+
"-Xjdk-release=17", // Needed due to https://youtrack.jetbrains.com/issue/KT-49746
53+
"-Xannotation-default-target=param-property" // Upcoming default, see https://youtrack.jetbrains.com/issue/KT-73255
54+
)
5055
}
5156

5257
dependencies {

gradle/spring-module.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ javadoc {
7878
// Change modularity mismatch from warn to info.
7979
// See https://github.com/spring-projects/spring-framework/issues/27497
8080
addStringOption("-link-modularity-mismatch", "info")
81-
// With the javadoc tool on Java 24, it appears that the 'reference'
81+
// With the javadoc tool on Java 25, it appears that the 'reference'
8282
// group is always active and the '-reference' flag is not honored.
8383
// Thus, we do NOT fail the build on Javadoc warnings due to
8484
// cross-module @see and @link references which are only reachable

spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/MultipartWebClientIntegrationTests.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import com.fasterxml.jackson.annotation.JsonCreator;
2727
import com.fasterxml.jackson.annotation.JsonProperty;
28+
import org.junit.jupiter.api.condition.JRE;
2829
import reactor.core.publisher.Flux;
2930
import reactor.core.publisher.Mono;
3031
import reactor.core.scheduler.Schedulers;
@@ -60,8 +61,10 @@
6061
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;
6162
import org.springframework.web.testfixture.http.server.reactive.bootstrap.AbstractHttpHandlerIntegrationTests;
6263
import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer;
64+
import org.springframework.web.testfixture.http.server.reactive.bootstrap.JettyHttpServer;
6365

6466
import static org.assertj.core.api.Assertions.assertThat;
67+
import static org.assertj.core.api.Assumptions.assumeThat;
6568

6669
class MultipartWebClientIntegrationTests extends AbstractHttpHandlerIntegrationTests {
6770

@@ -166,6 +169,11 @@ void filePartsMono(HttpServer httpServer) throws Exception {
166169

167170
@ParameterizedHttpServerTest
168171
void transferTo(HttpServer httpServer) throws Exception {
172+
// TODO https://github.com/spring-projects/spring-framework/issues/35531
173+
if (JRE.JAVA_25.isCurrentVersion()) {
174+
assumeThat(httpServer).isNotInstanceOf(JettyHttpServer.class);
175+
}
176+
169177
startServer(httpServer);
170178

171179
Flux<String> result = webClient

0 commit comments

Comments
 (0)