From 2eedeabe9ac1b70e7cbe7db012fbc1332ac9ef1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Tue, 14 Jul 2026 15:46:33 +0200 Subject: [PATCH] Upgrade to Gradle 9.6.1 This commit also suppresses new warnings from the Native Build Tools Plugin, see https://github.com/graalvm/native-build-tools/pull/903 Closes gh-50793 --- ...tiveImagePluginActionIntegrationTests.java | 26 +++++++++++++------ gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 4 +-- gradlew.bat | 4 +-- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/NativeImagePluginActionIntegrationTests.java b/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/NativeImagePluginActionIntegrationTests.java index 688ef99de8f..67a0d22b0f0 100644 --- a/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/NativeImagePluginActionIntegrationTests.java +++ b/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/NativeImagePluginActionIntegrationTests.java @@ -47,19 +47,23 @@ import static org.assertj.core.api.Assertions.assertThat; @GradleCompatibility(minimumVersion = "8.3") class NativeImagePluginActionIntegrationTests { + private static final String NATIVE_BUILD_TOOLS_DEPRECATION = "Using a Project object as a dependency notation has been deprecated"; + @SuppressWarnings("NullAway.Init") GradleBuild gradleBuild; @TestTemplate void applyingNativeImagePluginAppliesAotPlugin() { - assertThat(this.gradleBuild.build("aotPluginApplied").getOutput()) - .contains("org.springframework.boot.aot applied = true"); + assertThat(this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION) + .build("aotPluginApplied") + .getOutput()).contains("org.springframework.boot.aot applied = true"); } @TestTemplate void reachabilityMetadataConfigurationFilesAreCopiedToJar() throws IOException { writeDummySpringApplicationAotProcessorMainClass(); - BuildResult result = this.gradleBuild.build("bootJar"); + BuildResult result = this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION) + .build("bootJar"); BuildTask task = result.task(":bootJar"); assertThat(task).isNotNull(); assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS); @@ -79,7 +83,8 @@ class NativeImagePluginActionIntegrationTests { writeDummySpringApplicationAotProcessorMainClass(); FileSystemUtils.copyRecursively(new File("src/test/resources/reachability-metadata-repository"), new File(this.gradleBuild.getProjectDir(), "reachability-metadata-repository")); - BuildResult result = this.gradleBuild.build("bootJar"); + BuildResult result = this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION) + .build("bootJar"); BuildTask task = result.task(":bootJar"); assertThat(task).isNotNull(); assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS); @@ -97,20 +102,23 @@ class NativeImagePluginActionIntegrationTests { @TestTemplate void developmentOnlyDependenciesDoNotAppearInNativeImageClasspath() { writeDummySpringApplicationAotProcessorMainClass(); - BuildResult result = this.gradleBuild.build("checkNativeImageClasspath"); + BuildResult result = this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION) + .build("checkNativeImageClasspath"); assertThat(result.getOutput()).doesNotContain("commons-lang"); } @TestTemplate void testAndDevelopmentOnlyDependenciesDoNotAppearInNativeImageClasspath() { writeDummySpringApplicationAotProcessorMainClass(); - BuildResult result = this.gradleBuild.build("checkNativeImageClasspath"); + BuildResult result = this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION) + .build("checkNativeImageClasspath"); assertThat(result.getOutput()).doesNotContain("commons-lang"); } @TestTemplate void classesGeneratedDuringAotProcessingAreOnTheNativeImageClasspath() { - BuildResult result = this.gradleBuild.build("checkNativeImageClasspath"); + BuildResult result = this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION) + .build("checkNativeImageClasspath"); assertThat(result.getOutput()).contains(projectPath("build/classes/java/aot"), projectPath("build/resources/aot"), projectPath("build/generated/aotClasses")); } @@ -119,6 +127,7 @@ class NativeImagePluginActionIntegrationTests { void classesGeneratedDuringAotTestProcessingAreOnTheTestNativeImageClasspath() { BuildResult result = this.gradleBuild .scriptProperty("junitVersion", TestTemplate.class.getPackage().getImplementationVersion()) + .expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION) .build("checkTestNativeImageClasspath"); assertThat(result.getOutput()).contains(projectPath("build/classes/java/aotTest"), projectPath("build/resources/aotTest"), projectPath("build/generated/aotTestClasses")); @@ -127,7 +136,8 @@ class NativeImagePluginActionIntegrationTests { @TestTemplate void nativeEntryIsAddedToManifest() throws IOException { writeDummySpringApplicationAotProcessorMainClass(); - BuildResult result = this.gradleBuild.build("bootJar"); + BuildResult result = this.gradleBuild.expectDeprecationMessages(NATIVE_BUILD_TOOLS_DEPRECATION) + .build("bootJar"); BuildTask task = result.task(":bootJar"); assertThat(task).isNotNull(); assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS); diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b52fb7e713a..a9db11550c6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip networkTimeout=10000 retries=0 retryBackOffMs=500 diff --git a/gradlew b/gradlew index b9bb139f790..249efbb032c 100755 --- a/gradlew +++ b/gradlew @@ -20,7 +20,7 @@ ############################################################################## # -# Gradle start up script for POSIX generated by Gradle. +# gradlew start up script for POSIX generated by Gradle. # # Important for running: # @@ -29,7 +29,7 @@ # bash, then to run this script, type that shell name before the whole # command line, like: # -# ksh Gradle +# ksh gradlew # # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: diff --git a/gradlew.bat b/gradlew.bat index aa5f10b069f..8508ef684d4 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -19,7 +19,7 @@ @if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem -@rem Gradle startup script for Windows +@rem gradlew startup script for Windows @rem @rem ########################################################################## @@ -72,7 +72,7 @@ echo location of your Java installation. 1>&2 -@rem Execute Gradle +@rem Execute gradlew @rem endlocal doesn't take effect until after the line is parsed and variables are expanded @rem which allows us to clear the local environment before executing the java command endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel