From 5502aaafd1671b68b5b0bac138d8878468afb9db Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 19 Oct 2017 12:11:04 +0100 Subject: [PATCH] Use mainClassName consistently across BootRun, BootJar, and BootWar Previously, BootRun used the main property to configure the name of the main class to run while BootJar and BootWar used the mainClass property. Both were different to the application plugin which provides a mainClassName project property. This commit updates BootRun, BootJar, and BootWar to change the name of the property used to configure the name of the main class to be mainClassName. This makes the three Boot-specific tasks consistent with each other, and also aligns them with Gradle's own application plugin. Closes gh-10622 --- .../src/main/asciidoc/packaging.adoc | 3 +- .../src/main/asciidoc/running.adoc | 4 +-- .../gradle/packaging/boot-jar-and-jar.gradle | 2 +- .../boot-jar-custom-launch-script.gradle | 2 +- .../boot-jar-include-launch-script.gradle | 2 +- .../boot-jar-launch-script-properties.gradle | 2 +- .../packaging/boot-jar-main-class.gradle | 2 +- .../packaging/boot-jar-requires-unpack.gradle | 2 +- .../boot-war-include-devtools.gradle | 2 +- .../boot-war-properties-launcher.gradle | 2 +- .../application-plugin-main-class-name.gradle | 2 +- .../main/gradle/running/boot-run-main.gradle | 4 +-- .../boot/gradle/plugin/JavaPluginAction.java | 4 +-- .../boot/gradle/plugin/WarPluginAction.java | 2 +- .../gradle/tasks/bundling/BootArchive.java | 12 +++---- .../tasks/bundling/BootArchiveSupport.java | 4 +-- .../boot/gradle/tasks/bundling/BootJar.java | 12 +++---- .../boot/gradle/tasks/bundling/BootWar.java | 12 +++---- .../boot/gradle/tasks/run/BootRun.java | 24 ++++++------- .../bundling/AbstractBootArchiveTests.java | 34 +++++++++---------- .../gradle/tasks/bundling/BootWarTests.java | 8 ++--- ...sts-tarDistributionForJarCanBeBuilt.gradle | 2 +- ...sts-tarDistributionForWarCanBeBuilt.gradle | 2 +- ...sts-zipDistributionForJarCanBeBuilt.gradle | 2 +- ...sts-zipDistributionForWarCanBeBuilt.gradle | 2 +- ...-assembleRunsBootJarAndJarIsSkipped.gradle | 2 +- ...onTests-jarAndBootJarCanBothBeBuilt.gradle | 2 +- ...-assembleRunsBootWarAndWarIsSkipped.gradle | 2 +- ...onTests-warAndBootWarCanBothBeBuilt.gradle | 2 +- ...ests-duplicatesAreHandledGracefully.gradle | 2 +- .../bundling/BootJarIntegrationTests.gradle | 2 +- .../bundling/BootWarIntegrationTests.gradle | 2 +- ...tegrationTests-bootJarCanBeUploaded.gradle | 2 +- ...tegrationTests-bootWarCanBeUploaded.gradle | 2 +- ...egrationTests-bootJarCanBePublished.gradle | 2 +- ...egrationTests-bootWarCanBePublished.gradle | 2 +- ...nMainClassNameIsNotUsedWhenItIsNull.gradle | 2 +- ...pplicationPluginMainClassNameIsUsed.gradle | 2 +- 38 files changed, 88 insertions(+), 87 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/packaging.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/packaging.adoc index 76d5319843..e435d6a50f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/packaging.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/packaging.adoc @@ -85,7 +85,8 @@ By default, the executable archive's main class will be configured automatically looking for a class with a `public static void main(String[])` method in directories on the task's classpath. -The main class can also be configured explicitly using the task's `mainClass` property: +The main class can also be configured explicitly using the task's `mainClassName` +property: [source,groovy,indent=0,subs="verbatim"] ---- diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/running.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/running.adoc index 419fd60b43..c4f2c65ded 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/running.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/running.adoc @@ -11,8 +11,8 @@ To run your application without first building an archive use the `bootRun` task The `bootRun` task is automatically configured to use the runtime classpath of the main source set. By default, the main class will be discovered by looking for a class with a `public static void main(String[])` method in directories on the task's -classpath. The main class can also be configured explicitly using the task's `main` -property: +classpath. The main class can also be configured explicitly using the task's +`mainClassName` property: [source,groovy,indent=0,subs="verbatim"] ---- 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 c96b34d52f..435c9def48 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 @@ -20,5 +20,5 @@ bootJar { // end::classifier[] bootJar { - mainClass = 'com.example.Application' + mainClassName = 'com.example.Application' } 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 9bfd8d6cb6..73eacd983e 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 @@ -8,7 +8,7 @@ apply plugin: 'org.springframework.boot' apply plugin: 'java' bootJar { - mainClass 'com.example.ExampleApplication' + mainClassName 'com.example.ExampleApplication' } // tag::custom-launch-script[] 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 df09f842de..6a9467263b 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 @@ -8,7 +8,7 @@ apply plugin: 'org.springframework.boot' apply plugin: 'java' bootJar { - mainClass 'com.example.ExampleApplication' + mainClassName 'com.example.ExampleApplication' } // tag::include-launch-script[] 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 dd1aec1cc6..c84490bde6 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 @@ -8,7 +8,7 @@ apply plugin: 'org.springframework.boot' apply plugin: 'java' bootJar { - mainClass 'com.example.ExampleApplication' + mainClassName 'com.example.ExampleApplication' } // tag::launch-script-properties[] 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 b3ce53b9ec..6e2784494b 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 @@ -9,6 +9,6 @@ apply plugin: 'java' // tag::main-class[] bootJar { - mainClass = 'com.example.ExampleApplication' + 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-requires-unpack.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle index e21da8d831..e7806982a7 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 @@ -16,7 +16,7 @@ dependencies { } bootJar { - mainClass 'com.example.ExampleApplication' + mainClassName 'com.example.ExampleApplication' } // tag::requires-unpack[] 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 a739250d3b..660bb2ac01 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 @@ -8,7 +8,7 @@ apply plugin: 'org.springframework.boot' apply plugin: 'war' bootWar { - mainClass 'com.example.ExampleApplication' + 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 a2d915d905..8fb7deb3e5 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 @@ -8,7 +8,7 @@ apply plugin: 'org.springframework.boot' apply plugin: 'war' bootWar { - mainClass 'com.example.ExampleApplication' + mainClassName 'com.example.ExampleApplication' } // tag::properties-launcher[] 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 6e05ceaa3d..049a0b6b30 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 @@ -14,6 +14,6 @@ mainClassName = 'com.example.ExampleApplication' task configuredMainClass { doLast { - println bootRun.main + println bootRun.mainClassName } } 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 82907a4c4e..6a9028aa46 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 @@ -9,12 +9,12 @@ apply plugin: 'java' // tag::main[] bootRun { - main = 'com.example.ExampleApplication' + mainClassName = 'com.example.ExampleApplication' } // end::main[] task configuredMainClass { doLast { - println bootRun.main + println bootRun.mainClassName } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java index 89269d7710..4c1a40ac3d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java @@ -87,7 +87,7 @@ final class JavaPluginAction implements PluginApplicationAction { .getByName(SourceSet.MAIN_SOURCE_SET_NAME); return mainSourceSet.getRuntimeClasspath(); }); - bootJar.conventionMapping("mainClass", + bootJar.conventionMapping("mainClassName", new MainClassConvention(project, bootJar::getClasspath)); return bootJar; } @@ -112,7 +112,7 @@ final class JavaPluginAction implements PluginApplicationAction { } return Collections.emptyList(); })); - run.setMain( + run.setMainClassName( project.provider(new MainClassConvention(project, run::getClasspath))); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/WarPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/WarPluginAction.java index 8619bd90b1..2c4c7f10ef 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/WarPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/WarPluginAction.java @@ -55,7 +55,7 @@ class WarPluginAction implements PluginApplicationAction { bootWar.providedClasspath(providedRuntimeConfiguration(project)); ArchivePublishArtifact artifact = new ArchivePublishArtifact(bootWar); this.singlePublishedArtifact.addCandidate(artifact); - bootWar.conventionMapping("mainClass", + bootWar.conventionMapping("mainClassName", new MainClassConvention(project, bootWar::getClasspath)); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchive.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchive.java index d2facdc820..c82b6a461c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchive.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchive.java @@ -35,20 +35,20 @@ import org.gradle.api.tasks.Optional; public interface BootArchive extends Task { /** - * Returns the main class of the application. + * Returns the name of the main class of the application. * - * @return the main class + * @return the main class name */ @Input @Optional - String getMainClass(); + String getMainClassName(); /** - * Sets the main class of the application. + * Sets the name of the main class of the application. * - * @param mainClass the main class of the application + * @param mainClassName the name of the main class of the application */ - void setMainClass(String mainClass); + void setMainClassName(String mainClassName); /** * Adds Ant-style patterns that identify files that must be unpacked from the archive diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java index a88437e31e..7e31cf4faf 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java @@ -73,10 +73,10 @@ class BootArchiveSupport { configureExclusions(); } - void configureManifest(Jar jar, String mainClass) { + void configureManifest(Jar jar, String mainClassName) { Attributes attributes = jar.getManifest().getAttributes(); attributes.putIfAbsent("Main-Class", this.loaderMainClass); - attributes.putIfAbsent("Start-Class", mainClass); + attributes.putIfAbsent("Start-Class", mainClassName); } CopyAction createCopyAction(Jar jar) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java index 17cce41b4b..7cc5e93c1a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java @@ -42,7 +42,7 @@ public class BootJar extends Jar implements BootArchive { private FileCollection classpath; - private String mainClass; + private String mainClassName; /** * Creates a new {@code BootJar} task. @@ -63,7 +63,7 @@ public class BootJar extends Jar implements BootArchive { @Override public void copy() { - this.support.configureManifest(this, getMainClass()); + this.support.configureManifest(this, getMainClassName()); super.copy(); } @@ -73,13 +73,13 @@ public class BootJar extends Jar implements BootArchive { } @Override - public String getMainClass() { - return this.mainClass; + public String getMainClassName() { + return this.mainClassName; } @Override - public void setMainClass(String mainClass) { - this.mainClass = mainClass; + public void setMainClassName(String mainClassName) { + this.mainClassName = mainClassName; } @Override diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java index 76da1058eb..af851011ef 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java @@ -41,7 +41,7 @@ public class BootWar extends War implements BootArchive { private final BootArchiveSupport support = new BootArchiveSupport( "org.springframework.boot.loader.WarLauncher", this::resolveZipCompression); - private String mainClass; + private String mainClassName; private FileCollection providedClasspath; @@ -57,7 +57,7 @@ public class BootWar extends War implements BootArchive { @Override public void copy() { - this.support.configureManifest(this, getMainClass()); + this.support.configureManifest(this, getMainClassName()); super.copy(); } @@ -67,13 +67,13 @@ public class BootWar extends War implements BootArchive { } @Override - public String getMainClass() { - return this.mainClass; + public String getMainClassName() { + return this.mainClassName; } @Override - public void setMainClass(String mainClass) { - this.mainClass = mainClass; + public void setMainClassName(String mainClass) { + this.mainClassName = mainClass; } @Override diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/run/BootRun.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/run/BootRun.java index a770e0fd08..29af82967c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/run/BootRun.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/run/BootRun.java @@ -40,7 +40,7 @@ import org.gradle.process.JavaExecSpec; */ public class BootRun extends DefaultTask { - private final PropertyState main = getProject().property(String.class); + private final PropertyState mainClassName = getProject().property(String.class); @SuppressWarnings("unchecked") private final PropertyState> jvmArgs = (PropertyState>) (Object) getProject() @@ -85,26 +85,26 @@ public class BootRun extends DefaultTask { * Returns the name of the main class to be run. * @return the main class name or {@code null} */ - public String getMain() { - return this.main.getOrNull(); + public String getMainClassName() { + return this.mainClassName.getOrNull(); } /** - * Sets the main class to be executed using the given {@code mainProvider}. + * Sets the name of the main class to be executed using the given {@code mainClassNameProvider}. * - * @param mainProvider provider of the main class name + * @param mainClassNameProvider provider of the main class name */ - public void setMain(Provider mainProvider) { - this.main.set(mainProvider); + public void setMainClassName(Provider mainClassNameProvider) { + this.mainClassName.set(mainClassNameProvider); } /** - * Sets the main class to be run. + * Sets the name of the main class to be run. * - * @param main the main class name + * @param mainClassName the main class name */ - public void setMain(String main) { - this.main.set(main); + public void setMainClassName(String mainClassName) { + this.mainClassName.set(mainClassName); } /** @@ -171,7 +171,7 @@ public class BootRun extends DefaultTask { public void run() { getProject().javaexec((spec) -> { spec.classpath(this.classpath); - spec.setMain(this.main.getOrNull()); + spec.setMain(this.mainClassName.getOrNull()); if (this.jvmArgs.isPresent()) { spec.setJvmArgs(this.jvmArgs.get()); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java index 47071cc993..049bb0302d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java @@ -89,7 +89,7 @@ public abstract class AbstractBootArchiveTests { @Test public void basicArchiveCreation() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.execute(); assertThat(this.task.getArchivePath().exists()); try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { @@ -102,7 +102,7 @@ public abstract class AbstractBootArchiveTests { @Test public void classpathJarsArePackagedBeneathLibPath() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.classpath(this.temp.newFile("one.jar"), this.temp.newFile("two.jar")); this.task.execute(); try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { @@ -113,7 +113,7 @@ public abstract class AbstractBootArchiveTests { @Test public void classpathFoldersArePackagedBeneathClassesPath() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); File classpathFolder = this.temp.newFolder(); File applicationClass = new File(classpathFolder, "com/example/Application.class"); @@ -130,7 +130,7 @@ public abstract class AbstractBootArchiveTests { @Test public void loaderIsWrittenToTheRootOfTheJar() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.execute(); try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { assertThat(jarFile.getEntry( @@ -143,7 +143,7 @@ public abstract class AbstractBootArchiveTests { @Test public void loaderIsWrittenToTheRootOfTheJarWhenUsingThePropertiesLauncher() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.execute(); this.task.getManifest().getAttributes().put("Main-Class", "org.springframework.boot.loader.PropertiesLauncher"); @@ -157,7 +157,7 @@ public abstract class AbstractBootArchiveTests { @Test public void unpackCommentIsAddedToEntryIdentifiedByAPattern() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.classpath(this.temp.newFile("one.jar"), this.temp.newFile("two.jar")); this.task.requiresUnpack("**/one.jar"); this.task.execute(); @@ -170,7 +170,7 @@ public abstract class AbstractBootArchiveTests { @Test public void unpackCommentIsAddedToEntryIdentifiedByASpec() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.classpath(this.temp.newFile("one.jar"), this.temp.newFile("two.jar")); this.task.requiresUnpack((element) -> element.getName().endsWith("two.jar")); this.task.execute(); @@ -183,7 +183,7 @@ public abstract class AbstractBootArchiveTests { @Test public void launchScriptCanBePrepended() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.launchScript(); this.task.execute(); assertThat(Files.readAllBytes(this.task.getArchivePath().toPath())) @@ -200,7 +200,7 @@ public abstract class AbstractBootArchiveTests { @Test public void customLaunchScriptCanBePrepended() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); File customScript = this.temp.newFile("custom.script"); Files.write(customScript.toPath(), Arrays.asList("custom script"), StandardOpenOption.CREATE); @@ -212,7 +212,7 @@ public abstract class AbstractBootArchiveTests { @Test public void launchScriptPropertiesAreReplaced() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.launchScript((configuration) -> configuration.getProperties() .put("initInfoProvides", "test property value")); this.task.execute(); @@ -222,7 +222,7 @@ public abstract class AbstractBootArchiveTests { @Test public void customMainClassInTheManifestIsHonored() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.getManifest().getAttributes().put("Main-Class", "com.example.CustomLauncher"); this.task.execute(); @@ -240,7 +240,7 @@ public abstract class AbstractBootArchiveTests { @Test public void customStartClassInTheManifestIsHonored() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.getManifest().getAttributes().put("Start-Class", "com.example.CustomMain"); this.task.execute(); @@ -255,7 +255,7 @@ public abstract class AbstractBootArchiveTests { @Test public void fileTimestampPreservationCanBeDisabled() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.setPreserveFileTimestamps(false); this.task.execute(); assertThat(this.task.getArchivePath().exists()); @@ -271,7 +271,7 @@ public abstract class AbstractBootArchiveTests { @Test public void reproducibleOrderingCanBeEnabled() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.from(this.temp.newFile("bravo.txt"), this.temp.newFile("alpha.txt"), this.temp.newFile("charlie.txt")); this.task.setReproducibleFileOrder(true); @@ -292,7 +292,7 @@ public abstract class AbstractBootArchiveTests { @Test public void devtoolsJarIsExcludedByDefault() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.classpath(this.temp.newFile("spring-boot-devtools-0.1.2.jar")); this.task.execute(); assertThat(this.task.getArchivePath().exists()); @@ -304,7 +304,7 @@ public abstract class AbstractBootArchiveTests { @Test public void devtoolsJarCanBeIncluded() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.classpath(this.temp.newFile("spring-boot-devtools-0.1.2.jar")); this.task.setExcludeDevtools(false); this.task.execute(); @@ -317,7 +317,7 @@ public abstract class AbstractBootArchiveTests { @Test public void allEntriesUseUnixPlatformAndUtf8NameEncoding() throws IOException { - this.task.setMainClass("com.example.Main"); + this.task.setMainClassName("com.example.Main"); this.task.setMetadataCharset("UTF-8"); File classpathFolder = this.temp.newFolder(); File resource = new File(classpathFolder, "some-resource.xml"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java index d61c8a622b..7eb999e5c2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java @@ -38,7 +38,7 @@ public class BootWarTests extends AbstractBootArchiveTests { @Test public void providedClasspathJarsArePackagedInWebInfLibProvided() throws IOException { - getTask().setMainClass("com.example.Main"); + getTask().setMainClassName("com.example.Main"); getTask().providedClasspath(this.temp.newFile("one.jar"), this.temp.newFile("two.jar")); getTask().execute(); @@ -51,7 +51,7 @@ public class BootWarTests extends AbstractBootArchiveTests { @Test public void devtoolsJarIsExcludedByDefaultWhenItsOnTheProvidedClasspath() throws IOException { - getTask().setMainClass("com.example.Main"); + getTask().setMainClassName("com.example.Main"); getTask().providedClasspath(this.temp.newFile("spring-boot-devtools-0.1.2.jar")); getTask().execute(); assertThat(getTask().getArchivePath().exists()); @@ -65,7 +65,7 @@ public class BootWarTests extends AbstractBootArchiveTests { @Test public void devtoolsJarCanBeIncludedWhenItsOnTheProvidedClasspath() throws IOException { - getTask().setMainClass("com.example.Main"); + getTask().setMainClassName("com.example.Main"); getTask().providedClasspath(this.temp.newFile("spring-boot-devtools-0.1.2.jar")); getTask().setExcludeDevtools(false); getTask().execute(); @@ -85,7 +85,7 @@ public class BootWarTests extends AbstractBootArchiveTests { orgFolder.mkdir(); new File(orgFolder, "foo.txt").createNewFile(); getTask().from(webappFolder); - getTask().setMainClass("com.example.Main"); + getTask().setMainClassName("com.example.Main"); getTask().execute(); assertThat(getTask().getArchivePath().exists()); try (JarFile jarFile = new JarFile(getTask().getArchivePath())) { 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 ed26697d0e..3f06faff0e 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 @@ -9,5 +9,5 @@ apply plugin: 'application' apply plugin: 'java' bootJar { - mainClass = 'com.example.ExampleApplication' + 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 aa4a2a7633..d1c91f3bda 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 @@ -9,5 +9,5 @@ apply plugin: 'application' apply plugin: 'war' bootWar { - mainClass = 'com.example.ExampleApplication' + 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 ed26697d0e..3f06faff0e 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 @@ -9,5 +9,5 @@ apply plugin: 'application' apply plugin: 'java' bootJar { - mainClass = 'com.example.ExampleApplication' + 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 aa4a2a7633..d1c91f3bda 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 @@ -9,5 +9,5 @@ apply plugin: 'application' apply plugin: 'war' bootWar { - mainClass = 'com.example.ExampleApplication' + 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/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 e0bd0696bf..c197148cd8 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 @@ -8,5 +8,5 @@ apply plugin: 'org.springframework.boot' apply plugin: 'java' bootJar { - mainClass = 'com.example.Application' + 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 0455a8bb42..bacf1a05c4 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 @@ -8,7 +8,7 @@ apply plugin: 'org.springframework.boot' apply plugin: 'java' bootJar { - mainClass = 'com.example.Application' + 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-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 a697574ea2..8275400db1 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 @@ -8,5 +8,5 @@ apply plugin: 'org.springframework.boot' apply plugin: 'war' bootWar { - mainClass = 'com.example.Application' + 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 bf47606bc8..f4d4e3cab4 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 @@ -8,7 +8,7 @@ apply plugin: 'org.springframework.boot' apply plugin: 'war' bootWar { - mainClass = 'com.example.Application' + 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/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 4209f27398..603d6e841b 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 @@ -8,7 +8,7 @@ apply plugin: 'java' apply plugin: 'org.springframework.boot' bootJar { - mainClass = 'com.example.CustomMain' + 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.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.gradle index f40163e7b2..b792a058b0 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 @@ -8,7 +8,7 @@ apply plugin: 'java' apply plugin: 'org.springframework.boot' bootJar { - mainClass = 'com.example.Application' + mainClassName = 'com.example.Application' if (project.hasProperty('includeLaunchScript') ? includeLaunchScript : false) { launchScript { properties 'prop' : project.hasProperty('launchScriptProperty') ? launchScriptProperty : 'default' 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 1d59feef6a..dcfae797b6 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 @@ -8,7 +8,7 @@ apply plugin: 'war' apply plugin: 'org.springframework.boot' bootWar { - mainClass = 'com.example.Application' + mainClassName = 'com.example.Application' if (project.hasProperty('includeLaunchScript') ? includeLaunchScript : false) { launchScript { properties 'prop' : project.hasProperty('launchScriptProperty') ? launchScriptProperty : 'default' 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 145bc8ac02..e0ba4eac7c 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 @@ -9,7 +9,7 @@ apply plugin: 'org.springframework.boot' apply plugin: 'maven' bootJar { - mainClass = 'com.example.Application' + mainClassName = 'com.example.Application' } group = 'com.example' 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 89c8e25f60..58a1ebf76d 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 @@ -9,7 +9,7 @@ apply plugin: 'org.springframework.boot' apply plugin: 'maven' bootWar { - mainClass = 'com.example.Application' + mainClassName = 'com.example.Application' } group = 'com.example' 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 6146899a6d..f407938323 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 @@ -9,7 +9,7 @@ apply plugin: 'org.springframework.boot' apply plugin: 'maven-publish' bootJar { - mainClass = 'com.example.Application' + mainClassName = 'com.example.Application' } group = 'com.example' 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 df3f763321..d1cc018623 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 @@ -9,7 +9,7 @@ apply plugin: 'org.springframework.boot' apply plugin: 'maven-publish' bootWar { - mainClass = 'com.example.Application' + mainClassName = 'com.example.Application' } group = 'com.example' 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 b839ef3a1a..75b8b3faa4 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 @@ -10,6 +10,6 @@ apply plugin: 'org.springframework.boot' task echoMainClassName { dependsOn compileJava doLast { - println 'Main class name = ' + bootRun.main + println 'Main class name = ' + bootRun.mainClassName } } 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 a9163cd7d3..62ca5b3090 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 @@ -10,5 +10,5 @@ apply plugin: 'org.springframework.boot' mainClassName = 'com.example.CustomMainClass' task echoMainClassName { - println 'Main class name = ' + bootRun.main + println 'Main class name = ' + bootRun.mainClassName }