diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/typical-plugins.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/typical-plugins.gradle index 6549d2bd3e44..8484298eab9e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/typical-plugins.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/typical-plugins.gradle @@ -1,7 +1,5 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'org.springframework.boot' version '{version}' } // tag::apply[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-additional.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-additional.gradle index a70995ea3804..229b16459133 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-additional.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-additional.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - // tag::additional[] springBoot { buildInfo { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-basic.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-basic.gradle index 43329cdd618d..ffa081cbdbcd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-basic.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-basic.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - // tag::build-info[] springBoot { buildInfo() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-custom-values.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-custom-values.gradle index c8e8b0b41680..c52d515f2867 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-custom-values.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-custom-values.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - // tag::custom-values[] springBoot { buildInfo { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/configure-bom.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/configure-bom.gradle index 00b62fe807d4..70bcdb2cb0f0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/configure-bom.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/configure-bom.gradle @@ -1,11 +1,6 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } -} - plugins { id 'java' + id 'org.springframework.boot' version '{version}' } apply plugin: 'io.spring.dependency-management' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/custom-version.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/custom-version.gradle index 54009ee8c20d..f5e022c57800 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/custom-version.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/custom-version.gradle @@ -1,10 +1,7 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' dependencyManagement { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/dependencies.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/dependencies.gradle index 7ee3a5726afe..44ff92d1ad1e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/dependencies.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/dependencies.gradle @@ -1,14 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } -} - plugins { id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' // tag::dependencies[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/application-plugin-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/application-plugin-main-class.gradle index b91321d8fdee..992486aeae6d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/application-plugin-main-class.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/application-plugin-main-class.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' -apply plugin: 'application' - // tag::main-class[] mainClassName = 'com.example.ExampleApplication' // end::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-and-jar.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-and-jar.gradle index 435c9def4883..17345aae90bf 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-and-jar.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-and-jar.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - // tag::enable-jar[] jar { enabled = true diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-custom-launch-script.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-custom-launch-script.gradle index 73eacd983e58..b2f0c04e2ce2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-custom-launch-script.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-custom-launch-script.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - bootJar { mainClassName 'com.example.ExampleApplication' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-include-launch-script.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-include-launch-script.gradle index 6a9467263b73..fb503be90011 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-include-launch-script.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-include-launch-script.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - bootJar { mainClassName 'com.example.ExampleApplication' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-launch-script-properties.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-launch-script-properties.gradle index c84490bde6d5..09dc1b3c168a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-launch-script-properties.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-launch-script-properties.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - bootJar { mainClassName 'com.example.ExampleApplication' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-main-class.gradle index 6e2784494b08..09a972481f1c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-main-class.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-main-class.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - // tag::main-class[] bootJar { mainClassName = 'com.example.ExampleApplication' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-manifest-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-manifest-main-class.gradle index 557242e3f1ed..1e983b5f0b19 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-manifest-main-class.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-manifest-main-class.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - // tag::main-class[] bootJar { manifest { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle index 168eeaff79b2..683cdca4b881 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - repositories { mavenCentral() } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-include-devtools.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-include-devtools.gradle index 660bb2ac0150..f30b9e0355fb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-include-devtools.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-include-devtools.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'war' - bootWar { mainClassName 'com.example.ExampleApplication' classpath file('spring-boot-devtools-1.2.3.RELEASE.jar') diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-properties-launcher.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-properties-launcher.gradle index 8fb7deb3e5b7..1996ff5a0f27 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-properties-launcher.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-properties-launcher.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'war' - bootWar { mainClassName 'com.example.ExampleApplication' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/spring-boot-dsl-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/spring-boot-dsl-main-class.gradle index f2f12ecbea76..6ef52ffaff8d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/spring-boot-dsl-main-class.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/spring-boot-dsl-main-class.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - // tag::main-class[] springBoot { mainClassName = 'com.example.ExampleApplication' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/war-container-dependency.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/war-container-dependency.gradle index 70712eac26d7..5901f7c4f51c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/war-container-dependency.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/war-container-dependency.gradle @@ -1,14 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } -} - plugins { id 'war' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' // tag::dependencies[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven-publish.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven-publish.gradle index 6a24def5df74..b3b06bbd22c2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven-publish.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven-publish.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'maven-publish' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' -apply plugin: 'maven-publish' - // tag::publishing[] publishing { publications { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven.gradle index 8adefa064318..37e5d90df21c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'maven' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' -apply plugin: 'maven' - // tag::upload[] uploadBootArchives { repositories { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/application-plugin-main-class-name.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/application-plugin-main-class-name.gradle index 6e05ceaa3df9..894cb9b75437 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/application-plugin-main-class-name.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/application-plugin-main-class-name.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' -apply plugin: 'application' - // tag::main-class[] mainClassName = 'com.example.ExampleApplication' // end::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-main.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-main.gradle index 82907a4c4e0f..aad2b96a43f7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-main.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-main.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - // tag::main[] bootRun { main = 'com.example.ExampleApplication' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-source-resources.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-source-resources.gradle index 19b016b52632..ba8bd7ace8a9 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-source-resources.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-source-resources.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - // tag::source-resources[] bootRun { sourceResources sourceSets.main diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/spring-boot-dsl-main-class-name.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/spring-boot-dsl-main-class-name.gradle index 710c093c4caf..793ac5bacde1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/spring-boot-dsl-main-class-name.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/spring-boot-dsl-main-class-name.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' -apply plugin: 'application' - // tag::main-class[] springBoot { mainClassName = 'com.example.ExampleApplication' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java index 3f63c69302b7..de66141ccfe8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java @@ -25,6 +25,7 @@ import java.util.Arrays; import java.util.List; import java.util.regex.Pattern; +import java.util.stream.Collectors; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpression; @@ -114,17 +115,18 @@ private void after() { GradleBuild.this.script = null; } - private String pluginClasspath() { - return absolutePath("bin") + "," + absolutePath("build/classes/java/main") + "," - + absolutePath("build/resources/main") + "," - + pathOfJarContaining(LaunchScript.class) + "," - + pathOfJarContaining(ClassVisitor.class) + "," - + pathOfJarContaining(DependencyManagementPlugin.class) + "," - + pathOfJarContaining(ArchiveEntry.class); + private List pluginClasspath() { + return Arrays.asList(new File("bin"), new File("build/classes/java/main"), + new File("build/resources/main"), + new File(pathOfJarContaining(LaunchScript.class)), + new File(pathOfJarContaining(ClassVisitor.class)), + new File(pathOfJarContaining(DependencyManagementPlugin.class)), + new File(pathOfJarContaining(ArchiveEntry.class))); } - private String absolutePath(String path) { - return new File(path).getAbsolutePath(); + private String pluginClasspathAsString() { + return pluginClasspath().stream().map(File::getAbsolutePath) + .collect(Collectors.joining(",")); } private String pathOfJarContaining(Class type) { @@ -160,14 +162,28 @@ public GradleRunner prepareRunner(String... arguments) throws IOException { FileCopyUtils.copy(scriptContent, new FileWriter(new File(this.projectDir, "build.gradle"))); GradleRunner gradleRunner = GradleRunner.create().withProjectDir(this.projectDir) - .withDebug(true); + .withDebug(true).withPluginClasspath(pluginClasspath()); + if (this.gradleVersion != null) { gradleRunner.withGradleVersion(this.gradleVersion); } List allArguments = new ArrayList<>(); - allArguments.add("-PpluginClasspath=" + pluginClasspath()); allArguments.add("-PbootVersion=" + getBootVersion()); allArguments.add("--stacktrace"); + + // this is necessary for the tests checking that we react correctly to the Kotlin + // plugin. + // Indeed, when using the plugins block to load the Boot plugin under test, + // relying on the plugin + // classpath set by withPluginClasspath(pluginClasspath()), the Boot plugin and + // the Kotlin plugin + // are loaded using two separate classloaders, and the Boot plugin thus doesn't + // see the Kotlin plugin + // class and can't react to it. To circumvent this test kit limitation, we set the + // classpath + // from the buildscript block of the build script, thanks to this pluginClasspath + // property + allArguments.add("-PpluginClasspath=" + pluginClasspathAsString()); allArguments.addAll(Arrays.asList(arguments)); return gradleRunner.withArguments(allArguments); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-additionalProperties.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-additionalProperties.gradle index 4335ef8445f5..04bd13b037d4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-additionalProperties.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-additionalProperties.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - group = 'com.example' version = '1.0' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-basicJar.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-basicJar.gradle index 92cd7455635c..46a3ceab0bd4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-basicJar.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-basicJar.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - group = 'com.example' version = '1.0' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-basicWar.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-basicWar.gradle index 6a627257c26c..7569863629c8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-basicWar.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-basicWar.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'war' - group = 'com.example' version = '1.0' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-classesDependency.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-classesDependency.gradle index e217894ff20f..43f8427085f8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-classesDependency.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-classesDependency.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - springBoot { buildInfo() } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-jarWithCustomName.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-jarWithCustomName.gradle index adb3428ee088..5abe1e05195c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-jarWithCustomName.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-jarWithCustomName.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - group = 'com.example' version = '1.0' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-warWithCustomName.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-warWithCustomName.gradle index e679477c1581..9239a0a84f7e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-warWithCustomName.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests-warWithCustomName.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'war' - group = 'com.example' version = '1.0' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-applicationNameCanBeUsedToCustomizeDistributionName.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-applicationNameCanBeUsedToCustomizeDistributionName.gradle index 3627c85681f7..6120cf651201 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-applicationNameCanBeUsedToCustomizeDistributionName.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-applicationNameCanBeUsedToCustomizeDistributionName.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'application' -apply plugin: 'java' - applicationName = 'custom' bootJar { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-scriptsHaveCorrectPermissions.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-scriptsHaveCorrectPermissions.gradle index 3f06faff0e9b..74450beaa862 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-scriptsHaveCorrectPermissions.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-scriptsHaveCorrectPermissions.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'application' -apply plugin: 'java' - bootJar { mainClassName = 'com.example.ExampleApplication' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-tarDistributionForJarCanBeBuilt.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-tarDistributionForJarCanBeBuilt.gradle index 3f06faff0e9b..74450beaa862 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-tarDistributionForJarCanBeBuilt.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-tarDistributionForJarCanBeBuilt.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'application' -apply plugin: 'java' - bootJar { mainClassName = 'com.example.ExampleApplication' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-tarDistributionForWarCanBeBuilt.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-tarDistributionForWarCanBeBuilt.gradle index d1c91f3bdaa9..71b35f403416 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-tarDistributionForWarCanBeBuilt.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-tarDistributionForWarCanBeBuilt.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'application' -apply plugin: 'war' - bootWar { mainClassName = 'com.example.ExampleApplication' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-zipDistributionForJarCanBeBuilt.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-zipDistributionForJarCanBeBuilt.gradle index 3f06faff0e9b..74450beaa862 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-zipDistributionForJarCanBeBuilt.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-zipDistributionForJarCanBeBuilt.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'application' -apply plugin: 'java' - bootJar { mainClassName = 'com.example.ExampleApplication' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-zipDistributionForWarCanBeBuilt.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-zipDistributionForWarCanBeBuilt.gradle index d1c91f3bdaa9..71b35f403416 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-zipDistributionForWarCanBeBuilt.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests-zipDistributionForWarCanBeBuilt.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'application' -apply plugin: 'war' - bootWar { mainClassName = 'com.example.ExampleApplication' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.gradle index d65bb50147f9..bf327cfdb7db 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.gradle @@ -1,11 +1,7 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' - if (project.hasProperty('applyApplicationPlugin')) { apply plugin: 'application' applicationDefaultJvmArgs = ['-Dcom.example.a=alpha', '-Dcom.example.b=bravo'] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests-helpfulErrorWhenVersionlessDependencyFailsToResolve.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests-helpfulErrorWhenVersionlessDependencyFailsToResolve.gradle index f80a0b67a819..4f9356dd1581 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests-helpfulErrorWhenVersionlessDependencyFailsToResolve.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests-helpfulErrorWhenVersionlessDependencyFailsToResolve.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'java' -apply plugin: 'org.springframework.boot' - repositories { mavenLocal() } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests.gradle index 12dca02ea44f..bde30790cc1c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'java' -apply plugin: 'org.springframework.boot' - if (project.hasProperty('applyDependencyManagementPlugin')) { apply plugin: 'io.spring.dependency-management' dependencyManagement { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-additionalMetadataLocationsConfiguredWhenProcessorIsPresent.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-additionalMetadataLocationsConfiguredWhenProcessorIsPresent.gradle index b53e1a8094c3..4bde9d4b09fb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-additionalMetadataLocationsConfiguredWhenProcessorIsPresent.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-additionalMetadataLocationsConfiguredWhenProcessorIsPresent.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - repositories { flatDir { dirs 'libs' } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-additionalMetadataLocationsNotConfiguredWhenProcessorIsAbsent.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-additionalMetadataLocationsNotConfiguredWhenProcessorIsAbsent.gradle index 1e502a8b8482..5fd735724db9 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-additionalMetadataLocationsNotConfiguredWhenProcessorIsAbsent.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-additionalMetadataLocationsNotConfiguredWhenProcessorIsAbsent.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - compileJava { doLast { println "$name compiler args: ${options.compilerArgs}" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-assembleRunsBootJarAndJarIsSkipped.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-assembleRunsBootJarAndJarIsSkipped.gradle index c197148cd8a6..e53e440aec90 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-assembleRunsBootJarAndJarIsSkipped.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-assembleRunsBootJarAndJarIsSkipped.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - bootJar { mainClassName = 'com.example.Application' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-jarAndBootJarCanBothBeBuilt.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-jarAndBootJarCanBothBeBuilt.gradle index bacf1a05c4e9..1d3126a70ecd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-jarAndBootJarCanBothBeBuilt.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-jarAndBootJarCanBothBeBuilt.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - bootJar { mainClassName = 'com.example.Application' classifier = 'boot' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksCanOverrideDefaultParametersCompilerFlag.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksCanOverrideDefaultParametersCompilerFlag.gradle index ad4850a8a584..e60a89436c7c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksCanOverrideDefaultParametersCompilerFlag.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksCanOverrideDefaultParametersCompilerFlag.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - tasks.withType(JavaCompile) { options.compilerArgs = ['-Xlint:all'] } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksUseParametersAndAdditionalCompilerFlags.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksUseParametersAndAdditionalCompilerFlags.gradle index f72a0ca10619..b93b99bfa26b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksUseParametersAndAdditionalCompilerFlags.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksUseParametersAndAdditionalCompilerFlags.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - tasks.withType(JavaCompile) { options.compilerArgs << '-Xlint:all' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksUseParametersCompilerFlagByDefault.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksUseParametersCompilerFlagByDefault.gradle index fec32ce90f3d..5f177371c390 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksUseParametersCompilerFlagByDefault.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-javaCompileTasksUseParametersCompilerFlagByDefault.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - task('javaCompileTasksCompilerArgs') { doFirst { tasks.withType(JavaCompile) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests.gradle index 70df201a02f9..7c633087a5a7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests.gradle @@ -1,11 +1,7 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' - if (project.hasProperty('applyJavaPlugin')) { apply plugin: 'java' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinCompileTasksCanOverrideDefaultJavaParametersFlag.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinCompileTasksCanOverrideDefaultJavaParametersFlag.gradle index fc6b58756f44..20fd64b9385b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinCompileTasksCanOverrideDefaultJavaParametersFlag.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinCompileTasksCanOverrideDefaultJavaParametersFlag.gradle @@ -1,3 +1,8 @@ +// this is necessary for the tests checking that we react correctly to the Kotlin plugin. +// Indeed, when using the plugins block to load the Boot plugin under test, relying on the plugin +// classpath set by the test kit gradle runner, the Boot plugin and the Kotlin plugin +// are loaded using two separate classloaders, and the Boot plugin thus doesn't see the Kotlin plugin +// class and can't react to it. To circumvent this test kit limitation, we set the classpath here. buildscript { dependencies { classpath files(pluginClasspath.split(',')) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinCompileTasksUseJavaParametersFlagByDefault.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinCompileTasksUseJavaParametersFlagByDefault.gradle index bce41d11bd04..9cf052978d10 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinCompileTasksUseJavaParametersFlagByDefault.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinCompileTasksUseJavaParametersFlagByDefault.gradle @@ -1,3 +1,8 @@ +// this is necessary for the tests checking that we react correctly to the Kotlin plugin. +// Indeed, when using the plugins block to load the Boot plugin under test, relying on the plugin +// classpath set by the test kit gradle runner, the Boot plugin and the Kotlin plugin +// are loaded using two separate classloaders, and the Boot plugin thus doesn't see the Kotlin plugin +// class and can't react to it. To circumvent this test kit limitation, we set the classpath here. buildscript { dependencies { classpath files(pluginClasspath.split(',')) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinVersionMatchesKotlinPluginVersion.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinVersionMatchesKotlinPluginVersion.gradle index 5bdc4b09a681..ee9c05852a6b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinVersionMatchesKotlinPluginVersion.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinVersionMatchesKotlinPluginVersion.gradle @@ -1,3 +1,8 @@ +// this is necessary for the tests checking that we react correctly to the Kotlin plugin. +// Indeed, when using the plugins block to load the Boot plugin under test, relying on the plugin +// classpath set by the test kit gradle runner, the Boot plugin and the Kotlin plugin +// are loaded using two separate classloaders, and the Boot plugin thus doesn't see the Kotlin plugin +// class and can't react to it. To circumvent this test kit limitation, we set the classpath here. buildscript { dependencies { classpath files(pluginClasspath.split(',')) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-noKotlinVersionPropertyWithoutKotlinPlugin.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-noKotlinVersionPropertyWithoutKotlinPlugin.gradle index 1f34d0a34b73..9a528c65014d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-noKotlinVersionPropertyWithoutKotlinPlugin.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-noKotlinVersionPropertyWithoutKotlinPlugin.gradle @@ -1,3 +1,8 @@ +// this is necessary for the tests checking that we react correctly to the Kotlin plugin. +// Indeed, when using the plugins block to load the Boot plugin under test, relying on the plugin +// classpath set by the test kit gradle runner, the Boot plugin and the Kotlin plugin +// are loaded using two separate classloaders, and the Boot plugin thus doesn't see the Kotlin plugin +// class and can't react to it. To circumvent this test kit limitation, we set the classpath here. buildscript { dependencies { classpath files(pluginClasspath.split(',')) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/MavenPluginActionIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/MavenPluginActionIntegrationTests.gradle index 068722c2fec8..8cccb4716bd2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/MavenPluginActionIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/MavenPluginActionIntegrationTests.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'maven' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' -apply plugin: 'maven' - task('conf2ScopeMappings') { doFirst { tasks.getByName('uploadBootArchives').repositories.withType(MavenResolver) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/OnlyDependencyManagementIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/OnlyDependencyManagementIntegrationTests.gradle index 40e2c8ed3811..2fe39651b219 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/OnlyDependencyManagementIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/OnlyDependencyManagementIntegrationTests.gradle @@ -1,11 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'org.springframework.boot' version '{version}' apply false + id 'java' } apply plugin: 'io.spring.dependency-management' -apply plugin: 'java' repositories { mavenLocal() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests-unresolvedDependenciesAreAnalyzedWhenDependencyResolutionFails.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests-unresolvedDependenciesAreAnalyzedWhenDependencyResolutionFails.gradle index 459fdbc6a3e5..8c187442cfb1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests-unresolvedDependenciesAreAnalyzedWhenDependencyResolutionFails.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests-unresolvedDependenciesAreAnalyzedWhenDependencyResolutionFails.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'java' - repositories { flatDir { dirs 'libs' } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests.gradle index 429f102ebc18..cf13509ffddd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests.gradle @@ -1,7 +1,3 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'org.springframework.boot' version '{version}' } - -apply plugin: 'org.springframework.boot' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/WarPluginActionIntegrationTests-assembleRunsBootWarAndWarIsSkipped.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/WarPluginActionIntegrationTests-assembleRunsBootWarAndWarIsSkipped.gradle index 8275400db136..6eb9c248f367 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/WarPluginActionIntegrationTests-assembleRunsBootWarAndWarIsSkipped.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/WarPluginActionIntegrationTests-assembleRunsBootWarAndWarIsSkipped.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'war' - bootWar { mainClassName = 'com.example.Application' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/WarPluginActionIntegrationTests-warAndBootWarCanBothBeBuilt.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/WarPluginActionIntegrationTests-warAndBootWarCanBothBeBuilt.gradle index f4d4e3cab4e3..fc129cef9660 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/WarPluginActionIntegrationTests-warAndBootWarCanBothBeBuilt.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/WarPluginActionIntegrationTests-warAndBootWarCanBothBeBuilt.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' -apply plugin: 'war' - bootWar { mainClassName = 'com.example.Application' classifier = 'boot' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/WarPluginActionIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/WarPluginActionIntegrationTests.gradle index 15ca34eec43a..e1ed4062c704 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/WarPluginActionIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/WarPluginActionIntegrationTests.gradle @@ -1,11 +1,7 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'org.springframework.boot' version '{version}' } -apply plugin: 'org.springframework.boot' - if (project.hasProperty('applyWarPlugin')) { apply plugin: 'war' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoIntegrationTests-defaultValues.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoIntegrationTests-defaultValues.gradle index 2fe8266de8b4..62b7abef2bcf 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoIntegrationTests-defaultValues.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoIntegrationTests-defaultValues.gradle @@ -1,7 +1,5 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'org.springframework.boot' version '{version}' apply false } def property(String name, Object defaultValue) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoIntegrationTests.gradle index 11b31a26d4dd..16571fb1c2a8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoIntegrationTests.gradle @@ -1,7 +1,5 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'org.springframework.boot' version '{version}' apply false } def property(String name, Object defaultValue) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle index 684171c14033..9f960fb8d9e3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle @@ -1,11 +1,7 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'java' -apply plugin: 'org.springframework.boot' -apply plugin: 'application' - mainClassName = 'com.example.CustomMain' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-duplicatesAreHandledGracefully.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-duplicatesAreHandledGracefully.gradle index 62cae4d47ff9..f53d0428c5dd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-duplicatesAreHandledGracefully.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-duplicatesAreHandledGracefully.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'java' -apply plugin: 'org.springframework.boot' - bootJar { mainClassName = 'com.example.CustomMain' duplicatesStrategy = "exclude" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-reproducibleArchive.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-reproducibleArchive.gradle index a20a9c109495..7fd1b1216fcd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-reproducibleArchive.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-reproducibleArchive.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'java' -apply plugin: 'org.springframework.boot' - bootJar { mainClassName = 'com.example.Application' preserveFileTimestamps = false diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-springBootExtensionMainClassNameIsUsed.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-springBootExtensionMainClassNameIsUsed.gradle index 8028ff416948..38af6a38f65b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-springBootExtensionMainClassNameIsUsed.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-springBootExtensionMainClassNameIsUsed.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'java' -apply plugin: 'org.springframework.boot' -apply plugin: 'application' - springBoot { mainClassName = 'com.example.CustomMain' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.gradle index b792a058b0d7..1befd0db0667 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'java' -apply plugin: 'org.springframework.boot' - bootJar { mainClassName = 'com.example.Application' if (project.hasProperty('includeLaunchScript') ? includeLaunchScript : false) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle index 8da00e317bf1..f19f5f82bd4d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-applicationPluginMainClassNameIsUsed.gradle @@ -1,11 +1,7 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'war' -apply plugin: 'org.springframework.boot' -apply plugin: 'application' - mainClassName = 'com.example.CustomMain' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-reproducibleArchive.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-reproducibleArchive.gradle index 4e1274f7ca29..ec17f4aa9225 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-reproducibleArchive.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-reproducibleArchive.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'war' -apply plugin: 'org.springframework.boot' - bootWar { mainClassName = 'com.example.Application' preserveFileTimestamps = false diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-springBootExtensionMainClassNameIsUsed.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-springBootExtensionMainClassNameIsUsed.gradle index 49f3a1ae174f..2ba6865c4030 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-springBootExtensionMainClassNameIsUsed.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-springBootExtensionMainClassNameIsUsed.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'war' -apply plugin: 'org.springframework.boot' -apply plugin: 'application' - springBoot { mainClassName = 'com.example.CustomMain' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests.gradle index dcfae797b63a..79fbe5579721 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'war' -apply plugin: 'org.springframework.boot' - bootWar { mainClassName = 'com.example.Application' if (project.hasProperty('includeLaunchScript') ? includeLaunchScript : false) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenIntegrationTests-bootJarCanBeUploaded.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenIntegrationTests-bootJarCanBeUploaded.gradle index e0ba4eac7c85..8a679f9c1dea 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenIntegrationTests-bootJarCanBeUploaded.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenIntegrationTests-bootJarCanBeUploaded.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'maven' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'java' -apply plugin: 'org.springframework.boot' -apply plugin: 'maven' - bootJar { mainClassName = 'com.example.Application' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenIntegrationTests-bootWarCanBeUploaded.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenIntegrationTests-bootWarCanBeUploaded.gradle index 58a1ebf76d0d..5c34f47cfc4a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenIntegrationTests-bootWarCanBeUploaded.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenIntegrationTests-bootWarCanBeUploaded.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'maven' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'war' -apply plugin: 'org.springframework.boot' -apply plugin: 'maven' - bootWar { mainClassName = 'com.example.Application' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenPublishingIntegrationTests-bootJarCanBePublished.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenPublishingIntegrationTests-bootJarCanBePublished.gradle index f407938323c8..ad434d134358 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenPublishingIntegrationTests-bootJarCanBePublished.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenPublishingIntegrationTests-bootJarCanBePublished.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'maven-publish' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'java' -apply plugin: 'org.springframework.boot' -apply plugin: 'maven-publish' - bootJar { mainClassName = 'com.example.Application' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenPublishingIntegrationTests-bootWarCanBePublished.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenPublishingIntegrationTests-bootWarCanBePublished.gradle index d1cc0186238c..432c5e1f6717 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenPublishingIntegrationTests-bootWarCanBePublished.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/MavenPublishingIntegrationTests-bootWarCanBePublished.gradle @@ -1,13 +1,9 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'war' + id 'maven-publish' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'war' -apply plugin: 'org.springframework.boot' -apply plugin: 'maven-publish' - bootWar { mainClassName = 'com.example.Application' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginJvmArgumentsAreUsed.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginJvmArgumentsAreUsed.gradle index 96047897b243..bdba96435511 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginJvmArgumentsAreUsed.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginJvmArgumentsAreUsed.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'application' -apply plugin: 'org.springframework.boot' - applicationDefaultJvmArgs = ['-Dcom.foo=bar', '-Dcom.bar=baz'] task echoJvmArguments { 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 b839ef3a1a6c..3187d8536f80 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 @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'application' -apply plugin: 'org.springframework.boot' - task echoMainClassName { dependsOn compileJava doLast { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsUsed.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsUsed.gradle index a9163cd7d3ea..f1a0ca76dbb1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsUsed.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-applicationPluginMainClassNameIsUsed.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'application' -apply plugin: 'org.springframework.boot' - mainClassName = 'com.example.CustomMainClass' task echoMainClassName { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-basicExecution.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-basicExecution.gradle index 97d0d1c7e3c5..feb1992eebd7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-basicExecution.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-basicExecution.gradle @@ -1,8 +1,4 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } - -apply plugin: 'java' -apply plugin: 'org.springframework.boot' diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-sourceResourcesCanBeUsed.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-sourceResourcesCanBeUsed.gradle index 47504d6d74a3..f5b9d8ed4cf7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-sourceResourcesCanBeUsed.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-sourceResourcesCanBeUsed.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'java' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'java' -apply plugin: 'org.springframework.boot' - bootRun { sourceResources sourceSets.main } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-springBootExtensionMainClassNameIsUsed.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-springBootExtensionMainClassNameIsUsed.gradle index 4be46ca96087..e2ce1837c038 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-springBootExtensionMainClassNameIsUsed.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests-springBootExtensionMainClassNameIsUsed.gradle @@ -1,12 +1,8 @@ -buildscript { - dependencies { - classpath files(pluginClasspath.split(',')) - } +plugins { + id 'application' + id 'org.springframework.boot' version '{version}' } -apply plugin: 'application' -apply plugin: 'org.springframework.boot' - springBoot { mainClassName = 'com.example.CustomMainClass' }