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
This commit is contained in:
Andy Wilkinson 2021-06-07 10:48:10 +01:00
parent 15721595fe
commit 87d35250a5
3 changed files with 4 additions and 4 deletions

View File

@ -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");
}
}

View File

@ -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'
}

View File

@ -5,6 +5,6 @@ plugins {
bootRun {
doFirst {
println "Main class name = ${bootRun.main}"
println "Main class name = ${bootRun.mainClass.get()}"
}
}