diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d4c978e8d3..8d7b1c54484 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,9 @@ jobs: toolchain: false - version: 23 toolchain: true + - version: 24 + early-access: true + toolchain: true exclude: - os: name: Linux diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle index 534a74739b1..4819bf526e2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle @@ -154,3 +154,7 @@ plugins.withType(EclipsePlugin) { } } } + +toolchain { + maximumCompatibleJavaVersion = JavaLanguageVersion.of(23) +} diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java index ec7812ee82d..e74c4a742dc 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,6 +44,8 @@ import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledForJreRange; +import org.junit.jupiter.api.condition.JRE; import org.mockito.InOrder; import org.springframework.boot.testsupport.web.servlet.ExampleServlet; @@ -308,6 +310,7 @@ class UndertowServletWebServerFactoryTests extends AbstractServletWebServerFacto } @Test + @DisabledForJreRange(min = JRE.JAVA_24) void sslRestrictedProtocolsRSATLS12Success() throws Exception { testRestrictedSSLProtocolsAndCipherSuites(new String[] { "TLSv1.2" }, new String[] { "TLS_RSA_WITH_AES_128_CBC_SHA256" }); diff --git a/spring-boot-system-tests/spring-boot-image-tests/build.gradle b/spring-boot-system-tests/spring-boot-image-tests/build.gradle index 919b1355f5c..3606d3752ce 100644 --- a/spring-boot-system-tests/spring-boot-image-tests/build.gradle +++ b/spring-boot-system-tests/spring-boot-image-tests/build.gradle @@ -42,3 +42,7 @@ dependencies { systemTestImplementation("org.testcontainers:junit-jupiter") systemTestImplementation("org.testcontainers:testcontainers") } + +toolchain { + maximumCompatibleJavaVersion = JavaLanguageVersion.of(23) +} diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-classic-tests/src/dockerTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-classic-tests/src/dockerTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java index 5508dd2fb07..99683fa4dd0 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-classic-tests/src/dockerTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-classic-tests/src/dockerTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java @@ -67,7 +67,18 @@ class LoaderIntegrationTests { .withLogConsumer(this.output) .withCopyFileToContainer(MountableFile.forHostPath(findApplication().toPath()), "/app.jar") .withStartupCheckStrategy(new OneShotStartupCheckStrategy().withTimeout(Duration.ofMinutes(5))) - .withCommand("java", "-jar", "app.jar"); + .withCommand(command(javaRuntime)); + } + + private String[] command(JavaRuntime javaRuntime) { + List command = new ArrayList<>(); + command.add("java"); + if (javaRuntime.version == JavaVersion.TWENTY_FOUR) { + command.add("--enable-native-access=ALL-UNNAMED"); + } + command.add("-jar"); + command.add("app.jar"); + return command.toArray(new String[0]); } private File findApplication() { @@ -84,6 +95,7 @@ class LoaderIntegrationTests { javaRuntimes.add(JavaRuntime.oracleJdk17()); javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.TWENTY_TWO)); javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.TWENTY_THREE)); + javaRuntimes.add(JavaRuntime.openJdkEarlyAccess(JavaVersion.TWENTY_FOUR)); return javaRuntimes.stream().filter(JavaRuntime::isCompatible); } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/dockerTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/dockerTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java index f033daa36fb..de3876bb69e 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/dockerTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-loader-tests/src/dockerTest/java/org/springframework/boot/loader/LoaderIntegrationTests.java @@ -90,7 +90,18 @@ class LoaderIntegrationTests { .withLogConsumer(this.output) .withCopyFileToContainer(findApplication(name, classifier), "/app.jar") .withStartupCheckStrategy(new OneShotStartupCheckStrategy().withTimeout(Duration.ofMinutes(5))) - .withCommand("java", "-jar", "app.jar"); + .withCommand(command(javaRuntime)); + } + + private String[] command(JavaRuntime javaRuntime) { + List command = new ArrayList<>(); + command.add("java"); + if (javaRuntime.version == JavaVersion.TWENTY_FOUR) { + command.add("--enable-native-access=ALL-UNNAMED"); + } + command.add("-jar"); + command.add("app.jar"); + return command.toArray(new String[0]); } private MountableFile findApplication(String name, String classifier) { @@ -112,6 +123,7 @@ class LoaderIntegrationTests { javaRuntimes.add(JavaRuntime.oracleJdk17()); javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.TWENTY_TWO)); javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.TWENTY_THREE)); + javaRuntimes.add(JavaRuntime.openJdkEarlyAccess(JavaVersion.TWENTY_FOUR)); return javaRuntimes.stream().filter(JavaRuntime::isCompatible); }