From 87d35250a58d416341aa86f7150338144cf3352a Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 7 Jun 2021 10:48:10 +0100 Subject: [PATCH] Test our Gradle plugin against 7.1-rc-1 7.1-rc-1 deprecates JavaExec's main property in favor of mainClass which was introduced in Gradle 6.4. This commit updates some tests to use mainClass rather than main that would otherwise have failed due to deprecation warnings in their output. Closes gh-26793 --- .../boot/gradle/junit/GradleCompatibilityExtension.java | 4 ++-- ...ootJarIntegrationTests-explodedApplicationClasspath.gradle | 2 +- ...applicationPluginMainClassNameIsNotUsedWhenItIsNull.gradle | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java index eca46d6f6b6..44f53c3a3fa 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java @@ -48,10 +48,10 @@ final class GradleCompatibilityExtension implements TestTemplateInvocationContex static { JavaVersion javaVersion = JavaVersion.current(); if (javaVersion.isCompatibleWith(JavaVersion.VERSION_16)) { - GRADLE_VERSIONS = Arrays.asList("7.0.2"); + GRADLE_VERSIONS = Arrays.asList("7.0.2", "7.1-rc-1"); } else { - GRADLE_VERSIONS = Arrays.asList("6.8.3", "current", "7.0.2"); + GRADLE_VERSIONS = Arrays.asList("6.8.3", "current", "7.0.2", "7.1-rc-1"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-explodedApplicationClasspath.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-explodedApplicationClasspath.gradle index e0774d64bad..f97b7df5b6b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-explodedApplicationClasspath.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-explodedApplicationClasspath.gradle @@ -21,5 +21,5 @@ task explode(type: Sync) { task launch(type: JavaExec) { classpath = files(explode) - main = 'org.springframework.boot.loader.JarLauncher' + mainClass = 'org.springframework.boot.loader.JarLauncher' } \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsNotUsedWhenItIsNull.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsNotUsedWhenItIsNull.gradle index 60be6e642a2..5e803a3fc5d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsNotUsedWhenItIsNull.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsNotUsedWhenItIsNull.gradle @@ -5,6 +5,6 @@ plugins { bootRun { doFirst { - println "Main class name = ${bootRun.main}" + println "Main class name = ${bootRun.mainClass.get()}" } } \ No newline at end of file