diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging.adoc index 6b92503368..28d8a8482e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging.adoc @@ -91,7 +91,7 @@ A number of configuration options that are specific to executable jars and wars ==== Configuring the Main Class By default, the executable archive's main class will be configured automatically 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 `mainClassName` property: +The main class can also be configured explicitly using the task's `mainClass` property: [source,groovy,indent=0,subs="verbatim,attributes",role="primary"] .Groovy @@ -105,7 +105,7 @@ include::../gradle/packaging/boot-jar-main-class.gradle[tags=main-class] include::../gradle/packaging/boot-jar-main-class.gradle.kts[tags=main-class] ---- -Alternatively, the main class name can be configured project-wide using the `mainClassName` property of the Spring Boot DSL: +Alternatively, the main class name can be configured project-wide using the `mainClass` property of the Spring Boot DSL: [source,groovy,indent=0,subs="verbatim,attributes",role="primary"] .Groovy diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc index fb8a024ee2..8b0a89866c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc @@ -27,7 +27,7 @@ include::../gradle/running/boot-run-main.gradle[tags=main] include::../gradle/running/boot-run-main.gradle.kts[tags=main] ---- -Alternatively, the main class name can be configured project-wide using the `mainClassName` property of the Spring Boot DSL: +Alternatively, the main class name can be configured project-wide using the `mainClass` property of the Spring Boot DSL: [source,groovy,indent=0,subs="verbatim,attributes",role="primary"] .Groovy diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle index 1008610293..4bb003ea60 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // tag::builder[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle.kts index 71b05174d9..d42323a0f5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-builder.gradle.kts @@ -6,7 +6,7 @@ plugins { } tasks.getByName("bootJar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // tag::builder[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle index 923effbf71..ebc3efb6a5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // tag::docker-auth-token[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle.kts index 050c32b7ee..4f5e633fd3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-token.gradle.kts @@ -7,7 +7,7 @@ plugins { } tasks.getByName("bootJar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // tag::docker-auth-token[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle index 4f50a16c4b..47606523bb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // tag::docker-auth-user[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle.kts index cbef59ea05..6ddcd1918d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-auth-user.gradle.kts @@ -7,7 +7,7 @@ plugins { } tasks.getByName("bootJar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // tag::docker-auth-user[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle index 5e000607df..d06629c83f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // tag::docker-host[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle.kts index 37463b66ee..8604e79b3e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-docker-host.gradle.kts @@ -7,7 +7,7 @@ plugins { } tasks.getByName("bootJar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // tag::docker-host[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy.gradle index 45ab0a9d52..84a3b105ae 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy.gradle @@ -3,10 +3,6 @@ plugins { id 'org.springframework.boot' version '{gradle-project-version}' } -bootJar { - mainClassName 'com.example.ExampleApplication' -} - // tag::env[] bootBuildImage { environment = [ diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle index 4d3f11545b..a9a7e9bc29 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle @@ -3,10 +3,6 @@ plugins { id 'org.springframework.boot' version '{gradle-project-version}' } -bootJar { - mainClassName 'com.example.ExampleApplication' -} - // tag::env[] bootBuildImage { environment = ["BP_JVM_VERSION" : "8.*"] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar.gradle index 45b72f9278..b6e8e28739 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar.gradle @@ -16,5 +16,5 @@ bootJar { // end::classifier[] bootJar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar.gradle.kts index 5d78503226..007a422dc5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar.gradle.kts @@ -18,5 +18,5 @@ tasks.getByName("bootJar") { // end::classifier[] tasks.getByName("bootJar") { - mainClassName = "com.example.Application" + mainClass.set("com.example.Application") } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle index e59f2e749b..d97dcc95c9 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // tag::custom-launch-script[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle.kts index 7d67b9a5a0..210debdad7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle.kts @@ -6,7 +6,7 @@ plugins { } tasks.getByName("bootJar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // tag::custom-launch-script[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle index 399b7b40ed..43bba7349d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // tag::include-launch-script[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle.kts index 87cd8f0d5c..24c44610c2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle.kts @@ -6,7 +6,7 @@ plugins { } tasks.getByName("bootJar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // tag::include-launch-script[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle index 9d8d00b1be..68c8f07998 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // tag::launch-script-properties[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle.kts index 2756ac2a09..992e8ac3eb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle.kts @@ -6,7 +6,7 @@ plugins { } tasks.getByName("bootJar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // tag::launch-script-properties[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle index 86f4587bc7..bab1c0f47f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // tag::layered[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle.kts index 43fd557dd8..6ec2cadf76 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-custom.gradle.kts @@ -6,7 +6,7 @@ plugins { } tasks.getByName("bootJar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // tag::layered[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle index 476309dede..3f660bca42 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // tag::layered[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle.kts index 889d4a2dad..ae8f6c185e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-disabled.gradle.kts @@ -6,7 +6,7 @@ plugins { } tasks.getByName("bootJar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // tag::layered[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle index c40f27076d..0ba07ac60d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // tag::layered[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle.kts index 7cefd7bcfd..5529523668 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-layered-exclude-tools.gradle.kts @@ -6,7 +6,7 @@ plugins { } tasks.getByName("bootJar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // tag::layered[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle index 73d57e6bc3..6a548bd3d5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle @@ -5,6 +5,6 @@ plugins { // tag::main-class[] bootJar { - mainClassName = 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // end::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle.kts index b0cd5dd296..64f87c333f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle.kts @@ -7,6 +7,6 @@ plugins { // tag::main-class[] tasks.getByName("bootJar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // end::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle index c028e804f4..ec798043d3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle @@ -12,7 +12,7 @@ dependencies { } bootJar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // tag::requires-unpack[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle.kts index ea45aea59b..e88d8f3d82 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle.kts @@ -14,7 +14,7 @@ dependencies { } tasks.getByName("bootJar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // tag::requires-unpack[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle index b32b45eeae..4efea4455d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle @@ -4,7 +4,7 @@ plugins { } bootWar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } dependencies { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle.kts index 5ff9582c27..5af9e5d81a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle.kts @@ -6,7 +6,7 @@ plugins { } tasks.getByName("bootWar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } dependencies { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle index e86f7924fc..3c1bf08c1d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle @@ -4,7 +4,7 @@ plugins { } bootWar { - mainClassName 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // tag::properties-launcher[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts index 14a893ac4f..8873f0a38b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts @@ -6,7 +6,7 @@ plugins { } tasks.getByName("bootWar") { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // tag::properties-launcher[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle index ffe2239d33..c84dffd88e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle @@ -5,6 +5,6 @@ plugins { // tag::main-class[] springBoot { - mainClassName = 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // end::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle.kts index 7d1059687a..a16e4502fb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle.kts @@ -5,6 +5,6 @@ plugins { // tag::main-class[] springBoot { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // end::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle index c491bab4ee..643ac4af13 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle @@ -6,7 +6,7 @@ plugins { // tag::main-class[] springBoot { - mainClassName = 'com.example.ExampleApplication' + mainClass = 'com.example.ExampleApplication' } // end::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle.kts index 81c32d39de..0c5688973e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle.kts +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle.kts @@ -8,7 +8,7 @@ plugins { // tag::main-class[] springBoot { - mainClassName = "com.example.ExampleApplication" + mainClass.set("com.example.ExampleApplication") } // end::main-class[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/dsl/SpringBootExtension.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/dsl/SpringBootExtension.java index ebc3e27620..6048deda24 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/dsl/SpringBootExtension.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/dsl/SpringBootExtension.java @@ -20,9 +20,11 @@ import java.io.File; import org.gradle.api.Action; import org.gradle.api.Project; +import org.gradle.api.model.ReplacedBy; import org.gradle.api.plugins.BasePlugin; import org.gradle.api.plugins.JavaPlugin; import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.provider.Property; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.TaskContainer; import org.gradle.api.tasks.TaskProvider; @@ -42,7 +44,7 @@ public class SpringBootExtension { private final Project project; - private String mainClassName; + private final Property mainClass; /** * Creates a new {@code SpringBootPluginExtension} that is associated with the given @@ -51,22 +53,38 @@ public class SpringBootExtension { */ public SpringBootExtension(Project project) { this.project = project; + this.mainClass = this.project.getObjects().property(String.class); } /** - * Returns the main class name of the application. - * @return the name of the application's main class + * Returns the fully-qualified name of the application's main class. + * @return the fully-qualified name of the application's main class + * @since 2.4.0 */ + public Property getMainClass() { + return this.mainClass; + } + + /** + * Returns the fully-qualified main class name of the application. + * @return the fully-qualified name of the application's main class + * @deprecated since 2.4.0 in favor of {@link #getMainClass()}. + */ + @Deprecated + @ReplacedBy("mainClass") public String getMainClassName() { - return this.mainClassName; + return this.mainClass.getOrNull(); } /** - * Sets the main class name of the application. - * @param mainClassName the name of the application's main class + * Sets the fully-qualified main class name of the application. + * @param mainClassName the fully-qualified name of the application's main class + * @deprecated since 2.4.0 in favour of {@link #getMainClass} and + * {@link Property#set(Object)} */ + @Deprecated public void setMainClassName(String mainClassName) { - this.mainClassName = mainClassName; + this.mainClass.set(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 80fbb2948c..1e4f73b579 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 @@ -107,7 +107,11 @@ final class JavaPluginAction implements PluginApplicationAction { return mainSourceSet.getRuntimeClasspath().minus((developmentOnly.minus(productionRuntimeClasspath))) .filter(new JarTypeFileSpec()); }); - bootJar.conventionMapping("mainClassName", new MainClassConvention(project, bootJar::getClasspath)); + bootJar.getMainClass().convention(project.provider(() -> { + String manifestStartClass = (String) bootJar.getManifest().getAttributes().get("Start-Class"); + return (manifestStartClass != null) ? manifestStartClass + : new MainClassConvention(project, bootJar::getClasspath).call(); + })); }); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/MainClassConvention.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/MainClassConvention.java index 543f2a8f04..a7921c60ac 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/MainClassConvention.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/MainClassConvention.java @@ -37,7 +37,7 @@ import org.springframework.boot.loader.tools.MainClassFinder; * * @author Andy Wilkinson */ -final class MainClassConvention implements Callable { +final class MainClassConvention implements Callable { private static final String SPRING_BOOT_APPLICATION_CLASS_NAME = "org.springframework.boot.autoconfigure.SpringBootApplication"; @@ -51,10 +51,13 @@ final class MainClassConvention implements Callable { } @Override - public Object call() throws Exception { + public String call() throws Exception { SpringBootExtension springBootExtension = this.project.getExtensions().findByType(SpringBootExtension.class); - if (springBootExtension != null && springBootExtension.getMainClassName() != null) { - return springBootExtension.getMainClassName(); + if (springBootExtension != null) { + String mainClass = springBootExtension.getMainClass().getOrNull(); + if (mainClass != null) { + return mainClass; + } } String javaApplicationMainClass = getJavaApplicationMainClass(); return (javaApplicationMainClass != null) ? javaApplicationMainClass : resolveMainClass(); 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 66055bf2f4..b945d4c9a0 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 @@ -71,7 +71,11 @@ class WarPluginAction implements PluginApplicationAction { .getByName(SpringBootPlugin.PRODUCTION_RUNTIME_CLASSPATH_NAME); bootWar.setClasspath(bootWar.getClasspath().minus((developmentOnly.minus(productionRuntimeClasspath))) .filter(new JarTypeFileSpec())); - bootWar.conventionMapping("mainClassName", new MainClassConvention(project, bootWar::getClasspath)); + bootWar.getMainClass().convention(project.provider(() -> { + String manifestStartClass = (String) bootWar.getManifest().getAttributes().get("Start-Class"); + return (manifestStartClass != null) ? manifestStartClass + : new MainClassConvention(project, bootWar::getClasspath).call(); + })); }); } 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 8d1e48a48c..a03c2f0b0e 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 @@ -21,6 +21,8 @@ import org.gradle.api.Project; import org.gradle.api.Task; import org.gradle.api.file.FileCollection; import org.gradle.api.file.FileTreeElement; +import org.gradle.api.model.ReplacedBy; +import org.gradle.api.provider.Property; import org.gradle.api.specs.Spec; import org.gradle.api.tasks.Classpath; import org.gradle.api.tasks.Input; @@ -35,16 +37,29 @@ import org.gradle.api.tasks.Optional; public interface BootArchive extends Task { /** - * Returns the name of the main class of the application. - * @return the main class name + * Returns the fully-qualified name of the application's main class. + * @return the fully-qualified name of the application's main class + * @since 2.4.0 */ @Input + Property getMainClass(); + + /** + * Returns the fully-qualified main class name of the application. + * @return the fully-qualified name of the application's main class + * @deprecated since 2.4.0 in favor of {@link #getMainClass()}. + */ + @Deprecated + @ReplacedBy("mainClass") String getMainClassName(); /** - * Sets the name of the main class of the application. - * @param mainClassName the name of the main class of the application + * Sets the fully-qualified main class name of the application. + * @param mainClassName the fully-qualified name of the application's main class + * @deprecated since 2.4.0 in favour of {@link #getMainClass} and + * {@link Property#set(Object)} */ + @Deprecated void setMainClassName(String mainClassName); /** 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 a7e9f2fe96..a27ee8cfb9 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 @@ -28,6 +28,7 @@ import org.gradle.api.file.FileCollection; import org.gradle.api.file.FileCopyDetails; import org.gradle.api.file.FileTreeElement; import org.gradle.api.internal.file.copy.CopyAction; +import org.gradle.api.provider.Property; import org.gradle.api.specs.Spec; import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.Nested; @@ -60,7 +61,7 @@ public class BootJar extends Jar implements BootArchive { private final CopySpec bootInfSpec; - private String mainClassName; + private final Property mainClass; private FileCollection classpath; @@ -72,6 +73,7 @@ public class BootJar extends Jar implements BootArchive { public BootJar() { this.support = new BootArchiveSupport(LAUNCHER, this::isLibrary, this::resolveZipCompression); this.bootInfSpec = getProject().copySpec().into("BOOT-INF"); + this.mainClass = getProject().getObjects().property(String.class); configureBootInfSpec(this.bootInfSpec); getMainSpec().with(this.bootInfSpec); getProject().getConfigurations().all((configuration) -> { @@ -102,7 +104,7 @@ public class BootJar extends Jar implements BootArchive { @Override public void copy() { - this.support.configureManifest(getManifest(), getMainClassName(), CLASSES_DIRECTORY, LIB_DIRECTORY, + this.support.configureManifest(getManifest(), getMainClass().get(), CLASSES_DIRECTORY, LIB_DIRECTORY, CLASSPATH_INDEX, (isLayeredDisabled()) ? null : LAYERS_INDEX); super.copy(); } @@ -127,19 +129,20 @@ public class BootJar extends Jar implements BootArchive { } @Override + public Property getMainClass() { + return this.mainClass; + } + + @Override + @Deprecated public String getMainClassName() { - if (this.mainClassName == null) { - String manifestStartClass = (String) getManifest().getAttributes().get("Start-Class"); - if (manifestStartClass != null) { - setMainClassName(manifestStartClass); - } - } - return this.mainClassName; + return this.mainClass.getOrNull(); } @Override + @Deprecated public void setMainClassName(String mainClassName) { - this.mainClassName = mainClassName; + this.mainClass.set(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 ffaed0440e..95e2dd360e 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 @@ -26,6 +26,7 @@ import org.gradle.api.file.FileCollection; import org.gradle.api.file.FileCopyDetails; import org.gradle.api.file.FileTreeElement; import org.gradle.api.internal.file.copy.CopyAction; +import org.gradle.api.provider.Property; import org.gradle.api.specs.Spec; import org.gradle.api.tasks.Classpath; import org.gradle.api.tasks.Optional; @@ -50,7 +51,7 @@ public class BootWar extends War implements BootArchive { private final BootArchiveSupport support; - private String mainClassName; + private final Property mainClass; private FileCollection providedClasspath; @@ -59,6 +60,7 @@ public class BootWar extends War implements BootArchive { */ public BootWar() { this.support = new BootArchiveSupport(LAUNCHER, this::isLibrary, this::resolveZipCompression); + this.mainClass = getProject().getObjects().property(String.class); getWebInf().into("lib-provided", fromCallTo(this::getProvidedLibFiles)); this.support.moveModuleInfoToRoot(getRootSpec()); getRootSpec().eachFile(this.support::excludeNonZipLibraryFiles); @@ -70,7 +72,8 @@ public class BootWar extends War implements BootArchive { @Override public void copy() { - this.support.configureManifest(getManifest(), getMainClassName(), CLASSES_DIRECTORY, LIB_DIRECTORY, null, null); + this.support.configureManifest(getManifest(), getMainClass().get(), CLASSES_DIRECTORY, LIB_DIRECTORY, null, + null); super.copy(); } @@ -80,19 +83,20 @@ public class BootWar extends War implements BootArchive { } @Override + public Property getMainClass() { + return this.mainClass; + } + + @Override + @Deprecated public String getMainClassName() { - if (this.mainClassName == null) { - String manifestStartClass = (String) getManifest().getAttributes().get("Start-Class"); - if (manifestStartClass != null) { - setMainClassName(manifestStartClass); - } - } - return this.mainClassName; + return this.mainClass.getOrNull(); } @Override - public void setMainClassName(String mainClass) { - this.mainClassName = mainClass; + @Deprecated + public void setMainClassName(String mainClassName) { + this.mainClass.set(mainClassName); } @Override diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/MainClassConventionTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/MainClassConventionTests.java index cb6615cff9..f302391caa 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/MainClassConventionTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/MainClassConventionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ class MainClassConventionTests { void springBootExtensionMainClassNameIsUsed() throws Exception { SpringBootExtension extension = this.project.getExtensions().create("springBoot", SpringBootExtension.class, this.project); - extension.setMainClassName("com.example.MainClass"); + extension.getMainClass().set("com.example.MainClass"); assertThat(this.convention.call()).isEqualTo("com.example.MainClass"); } @@ -74,7 +74,7 @@ class MainClassConventionTests { javaApplication.setMainClassName("com.example.JavaApplicationMainClass"); SpringBootExtension extension = this.project.getExtensions().create("springBoot", SpringBootExtension.class, this.project); - extension.setMainClassName("com.example.SpringBootExtensionMainClass"); + extension.getMainClass().set("com.example.SpringBootExtensionMainClass"); assertThat(this.convention.call()).isEqualTo("com.example.SpringBootExtensionMainClass"); } 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 cd9ac97576..965a66b6c1 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 @@ -99,7 +99,7 @@ abstract class AbstractBootArchiveTests { @Test void basicArchiveCreation() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); executeTask(); try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getManifest().getMainAttributes().getValue("Main-Class")).isEqualTo(this.launcherClass); @@ -113,7 +113,7 @@ abstract class AbstractBootArchiveTests { @Test void classpathJarsArePackagedBeneathLibPathAndAreStored() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.classpath(jarFile("one.jar"), jarFile("two.jar")); executeTask(); try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { @@ -126,7 +126,7 @@ abstract class AbstractBootArchiveTests { @Test void classpathDirectoriesArePackagedBeneathClassesPath() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); File classpathDirectory = new File(this.temp, "classes"); File applicationClass = new File(classpathDirectory, "com/example/Application.class"); applicationClass.getParentFile().mkdirs(); @@ -140,7 +140,7 @@ abstract class AbstractBootArchiveTests { @Test void moduleInfoClassIsPackagedInTheRootOfTheArchive() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); File classpathDirectory = new File(this.temp, "classes"); File moduleInfoClass = new File(classpathDirectory, "module-info.class"); moduleInfoClass.getParentFile().mkdirs(); @@ -160,7 +160,7 @@ abstract class AbstractBootArchiveTests { @Test void classpathCanBeSetUsingAFileCollection() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.classpath(jarFile("one.jar")); this.task.setClasspath(this.task.getProject().files(jarFile("two.jar"))); executeTask(); @@ -172,7 +172,7 @@ abstract class AbstractBootArchiveTests { @Test void classpathCanBeSetUsingAnObject() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.classpath(jarFile("one.jar")); this.task.setClasspath(jarFile("two.jar")); executeTask(); @@ -184,7 +184,7 @@ abstract class AbstractBootArchiveTests { @Test void filesOnTheClasspathThatAreNotZipFilesAreSkipped() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.classpath(new File("test.pom")); executeTask(); try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { @@ -194,7 +194,7 @@ abstract class AbstractBootArchiveTests { @Test void loaderIsWrittenToTheRootOfTheJarAfterManifest() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); executeTask(); try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry("org/springframework/boot/loader/LaunchedURLClassLoader.class")).isNotNull(); @@ -210,7 +210,7 @@ abstract class AbstractBootArchiveTests { @Test void loaderIsWrittenToTheRootOfTheJarWhenUsingThePropertiesLauncher() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); executeTask(); this.task.getManifest().getAttributes().put("Main-Class", "org.springframework.boot.loader.PropertiesLauncher"); try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { @@ -221,7 +221,7 @@ abstract class AbstractBootArchiveTests { @Test void unpackCommentIsAddedToEntryIdentifiedByAPattern() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.classpath(jarFile("one.jar"), jarFile("two.jar")); this.task.requiresUnpack("**/one.jar"); executeTask(); @@ -233,7 +233,7 @@ abstract class AbstractBootArchiveTests { @Test void unpackCommentIsAddedToEntryIdentifiedByASpec() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.classpath(jarFile("one.jar"), jarFile("two.jar")); this.task.requiresUnpack((element) -> element.getName().endsWith("two.jar")); executeTask(); @@ -245,7 +245,7 @@ abstract class AbstractBootArchiveTests { @Test void launchScriptCanBePrepended() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.launchScript(); executeTask(); Map properties = new HashMap<>(); @@ -266,7 +266,7 @@ abstract class AbstractBootArchiveTests { @Test void customLaunchScriptCanBePrepended() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); File customScript = new File(this.temp, "custom.script"); Files.write(customScript.toPath(), Arrays.asList("custom script"), StandardOpenOption.CREATE); this.task.launchScript((configuration) -> configuration.setScript(customScript)); @@ -277,7 +277,7 @@ abstract class AbstractBootArchiveTests { @Test void launchScriptInitInfoPropertiesCanBeCustomized() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.launchScript((configuration) -> { configuration.getProperties().put("initInfoProvides", "provides"); configuration.getProperties().put("initInfoShortDescription", "short description"); @@ -292,7 +292,7 @@ abstract class AbstractBootArchiveTests { @Test void customMainClassInTheManifestIsHonored() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.getManifest().getAttributes().put("Main-Class", "com.example.CustomLauncher"); executeTask(); assertThat(this.task.getArchiveFile().get().getAsFile()).exists(); @@ -306,7 +306,7 @@ abstract class AbstractBootArchiveTests { @Test void customStartClassInTheManifestIsHonored() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.getManifest().getAttributes().put("Start-Class", "com.example.CustomMain"); executeTask(); assertThat(this.task.getArchiveFile().get().getAsFile()).exists(); @@ -319,7 +319,7 @@ abstract class AbstractBootArchiveTests { @Test void fileTimestampPreservationCanBeDisabled() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.setPreserveFileTimestamps(false); executeTask(); assertThat(this.task.getArchiveFile().get().getAsFile()).exists(); @@ -340,7 +340,7 @@ abstract class AbstractBootArchiveTests { @Test void reproducibleOrderingCanBeEnabled() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.from(newFile("bravo.txt"), newFile("alpha.txt"), newFile("charlie.txt")); this.task.setReproducibleFileOrder(true); executeTask(); @@ -360,7 +360,7 @@ abstract class AbstractBootArchiveTests { @Test void devtoolsJarIsExcludedByDefault() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.classpath(newFile("spring-boot-devtools-0.1.2.jar")); executeTask(); assertThat(this.task.getArchiveFile().get().getAsFile()).exists(); @@ -372,7 +372,7 @@ abstract class AbstractBootArchiveTests { @Test @Deprecated void devtoolsJarCanBeIncluded() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.classpath(jarFile("spring-boot-devtools-0.1.2.jar")); this.task.setExcludeDevtools(false); executeTask(); @@ -384,7 +384,7 @@ abstract class AbstractBootArchiveTests { @Test void allEntriesUseUnixPlatformAndUtf8NameEncoding() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); this.task.setMetadataCharset("UTF-8"); File classpathDirectory = new File(this.temp, "classes"); File resource = new File(classpathDirectory, "some-resource.xml"); @@ -405,7 +405,7 @@ abstract class AbstractBootArchiveTests { @Test void loaderIsWrittenFirstThenApplicationClassesThenLibraries() throws IOException { - this.task.setMainClassName("com.example.Main"); + this.task.getMainClass().set("com.example.Main"); File classpathDirectory = new File(this.temp, "classes"); File applicationClass = new File(classpathDirectory, "com/example/Application.class"); applicationClass.getParentFile().mkdirs(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java index 5abc46f0ae..2a95643d87 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java @@ -65,7 +65,7 @@ class BootJarTests extends AbstractBootArchiveTests { @Test void contentCanBeAddedToBootInfUsingCopySpecFromGetter() throws IOException { BootJar bootJar = getTask(); - bootJar.setMainClassName("com.example.Application"); + bootJar.getMainClass().set("com.example.Application"); bootJar.getBootInf().into("test").from(new File("build.gradle").getAbsolutePath()); bootJar.copy(); try (JarFile jarFile = new JarFile(bootJar.getArchiveFile().get().getAsFile())) { @@ -76,7 +76,7 @@ class BootJarTests extends AbstractBootArchiveTests { @Test void contentCanBeAddedToBootInfUsingCopySpecAction() throws IOException { BootJar bootJar = getTask(); - bootJar.setMainClassName("com.example.Application"); + bootJar.getMainClass().set("com.example.Application"); bootJar.bootInf((copySpec) -> copySpec.into("test").from(new File("build.gradle").getAbsolutePath())); bootJar.copy(); try (JarFile jarFile = new JarFile(bootJar.getArchiveFile().get().getAsFile())) { @@ -276,7 +276,7 @@ class BootJarTests extends AbstractBootArchiveTests { @SuppressWarnings("unchecked") private void addContent() throws IOException { BootJar bootJar = getTask(); - bootJar.setMainClassName("com.example.Main"); + bootJar.getMainClass().set("com.example.Main"); File classesJavaMain = new File(this.temp, "classes/java/main"); File applicationClass = new File(classesJavaMain, "com/example/Application.class"); applicationClass.getParentFile().mkdirs(); 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 b4fa84a653..1b234633e7 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 @@ -37,7 +37,7 @@ class BootWarTests extends AbstractBootArchiveTests { @Test void providedClasspathJarsArePackagedInWebInfLibProvided() throws IOException { - getTask().setMainClassName("com.example.Main"); + getTask().getMainClass().set("com.example.Main"); getTask().providedClasspath(jarFile("one.jar"), jarFile("two.jar")); executeTask(); try (JarFile jarFile = new JarFile(getTask().getArchiveFile().get().getAsFile())) { @@ -48,7 +48,7 @@ class BootWarTests extends AbstractBootArchiveTests { @Test void providedClasspathCanBeSetUsingAFileCollection() throws IOException { - getTask().setMainClassName("com.example.Main"); + getTask().getMainClass().set("com.example.Main"); getTask().providedClasspath(jarFile("one.jar")); getTask().setProvidedClasspath(getTask().getProject().files(jarFile("two.jar"))); executeTask(); @@ -60,7 +60,7 @@ class BootWarTests extends AbstractBootArchiveTests { @Test void providedClasspathCanBeSetUsingAnObject() throws IOException { - getTask().setMainClassName("com.example.Main"); + getTask().getMainClass().set("com.example.Main"); getTask().providedClasspath(jarFile("one.jar")); getTask().setProvidedClasspath(jarFile("two.jar")); executeTask(); @@ -72,7 +72,7 @@ class BootWarTests extends AbstractBootArchiveTests { @Test void devtoolsJarIsExcludedByDefaultWhenItsOnTheProvidedClasspath() throws IOException { - getTask().setMainClassName("com.example.Main"); + getTask().getMainClass().set("com.example.Main"); getTask().providedClasspath(newFile("spring-boot-devtools-0.1.2.jar")); executeTask(); try (JarFile jarFile = new JarFile(getTask().getArchiveFile().get().getAsFile())) { @@ -83,7 +83,7 @@ class BootWarTests extends AbstractBootArchiveTests { @Test @Deprecated void devtoolsJarCanBeIncludedWhenItsOnTheProvidedClasspath() throws IOException { - getTask().setMainClassName("com.example.Main"); + getTask().getMainClass().set("com.example.Main"); getTask().providedClasspath(jarFile("spring-boot-devtools-0.1.2.jar")); getTask().setExcludeDevtools(false); executeTask(); @@ -100,7 +100,7 @@ class BootWarTests extends AbstractBootArchiveTests { orgDirectory.mkdir(); new File(orgDirectory, "foo.txt").createNewFile(); getTask().from(webappDirectory); - getTask().setMainClassName("com.example.Main"); + getTask().getMainClass().set("com.example.Main"); executeTask(); try (JarFile jarFile = new JarFile(getTask().getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry("org/")).isNotNull(); @@ -110,7 +110,7 @@ class BootWarTests extends AbstractBootArchiveTests { @Test void libProvidedEntriesAreWrittenAfterLibEntries() throws IOException { - getTask().setMainClassName("com.example.Main"); + getTask().getMainClass().set("com.example.Main"); getTask().classpath(jarFile("library.jar")); getTask().providedClasspath(jarFile("provided-library.jar")); executeTask(); 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 6120cf6512..53ef2f261e 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 @@ -7,5 +7,5 @@ plugins { applicationName = 'custom' bootJar { - mainClassName = 'com.example.ExampleApplication' + mainClass = '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-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 74450beaa8..7446695620 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 @@ -5,5 +5,5 @@ plugins { } bootJar { - mainClassName = 'com.example.ExampleApplication' + mainClass = '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 74450beaa8..7446695620 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 @@ -5,5 +5,5 @@ plugins { } bootJar { - mainClassName = 'com.example.ExampleApplication' + mainClass = '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 71b35f4034..f623269682 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 @@ -5,5 +5,5 @@ plugins { } bootWar { - mainClassName = 'com.example.ExampleApplication' + mainClass = '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 74450beaa8..7446695620 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 @@ -5,5 +5,5 @@ plugins { } bootJar { - mainClassName = 'com.example.ExampleApplication' + mainClass = '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 71b35f4034..f623269682 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 @@ -5,5 +5,5 @@ plugins { } bootWar { - mainClassName = 'com.example.ExampleApplication' + mainClass = '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 e53e440aec..be0e82ef6d 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 @@ -4,5 +4,5 @@ plugins { } bootJar { - mainClassName = 'com.example.Application' + mainClass = '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 1d3126a70e..cf61891109 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 @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName = 'com.example.Application' + mainClass = '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 6eb9c248f3..a9db466bdf 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 @@ -4,5 +4,5 @@ plugins { } bootWar { - mainClassName = 'com.example.Application' + mainClass = '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 fc129cef96..59f033f186 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 @@ -4,7 +4,7 @@ plugins { } bootWar { - mainClassName = 'com.example.Application' + mainClass = '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-customLayers.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-customLayers.gradle index 7619fc25e3..3ba806e07e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-customLayers.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-customLayers.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' layered { application { intoLayer("static") { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-developmentOnlyDependenciesAreNotIncludedInTheArchive.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-developmentOnlyDependenciesAreNotIncludedInTheArchive.gradle index d7d658a366..cdbb87315a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-developmentOnlyDependenciesAreNotIncludedInTheArchive.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-developmentOnlyDependenciesAreNotIncludedInTheArchive.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' } repositories { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-developmentOnlyDependenciesAreNotIncludedInTheArchiveByDefault.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-developmentOnlyDependenciesAreNotIncludedInTheArchiveByDefault.gradle index 04b50c51f4..941f20aa4c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-developmentOnlyDependenciesAreNotIncludedInTheArchiveByDefault.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-developmentOnlyDependenciesAreNotIncludedInTheArchiveByDefault.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' } repositories { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-developmentOnlyDependenciesCanBeIncludedInTheArchive.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-developmentOnlyDependenciesCanBeIncludedInTheArchive.gradle index 0c4794a7dd..d035cf456e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-developmentOnlyDependenciesCanBeIncludedInTheArchive.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-developmentOnlyDependenciesCanBeIncludedInTheArchive.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' } repositories { 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 70ba8a86e5..4b6c9a46ed 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 @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName = 'com.example.CustomMain' + mainClass = '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-implicitLayers.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-implicitLayers.gradle index 0be9a5be73..c9166bac23 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-implicitLayers.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-implicitLayers.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' } repositories { @@ -28,4 +28,4 @@ task extractLayers(type: JavaExec) { classpath = bootJar.outputs.files systemProperties = [ "jarmode": "layertools" ] args "extract" -} \ No newline at end of file +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-jarTypeFilteringIsApplied.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-jarTypeFilteringIsApplied.gradle index 6e4087cb70..970d90d116 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-jarTypeFilteringIsApplied.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-jarTypeFilteringIsApplied.gradle @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' } repositories { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-layersWithCustomSourceSet.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-layersWithCustomSourceSet.gradle index 1db1c98abe..1f18bb3ebc 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-layersWithCustomSourceSet.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-layersWithCustomSourceSet.gradle @@ -8,7 +8,7 @@ sourceSets { } bootJar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' } repositories { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-multiModuleCustomLayers.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-multiModuleCustomLayers.gradle index f8bcb11afa..ef06bc2edb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-multiModuleCustomLayers.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-multiModuleCustomLayers.gradle @@ -10,7 +10,7 @@ subprojects { } bootJar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' layered { application { intoLayer("static") { 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 7fd1b1216f..4e69b45898 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 @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' preserveFileTimestamps = false reproducibleFileOrder = true } 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 38af6a38f6..821cd40ac0 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 @@ -5,5 +5,5 @@ plugins { } springBoot { - mainClassName = 'com.example.CustomMain' + mainClass = '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 5b6aa89104..21f090f87c 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 @@ -4,7 +4,7 @@ plugins { } bootJar { - mainClassName = 'com.example.Application' + mainClass = '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-developmentOnlyDependenciesAreNotIncludedInTheArchiveByDefault.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-developmentOnlyDependenciesAreNotIncludedInTheArchiveByDefault.gradle index 95ffda3b38..9354b000f6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-developmentOnlyDependenciesAreNotIncludedInTheArchiveByDefault.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-developmentOnlyDependenciesAreNotIncludedInTheArchiveByDefault.gradle @@ -4,7 +4,7 @@ plugins { } bootWar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' } repositories { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-developmentOnlyDependenciesCanBeIncludedInTheArchive.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-developmentOnlyDependenciesCanBeIncludedInTheArchive.gradle index 51c033d552..743a3a8e26 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-developmentOnlyDependenciesCanBeIncludedInTheArchive.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-developmentOnlyDependenciesCanBeIncludedInTheArchive.gradle @@ -4,7 +4,7 @@ plugins { } bootWar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' } repositories { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-jarTypeFilteringIsApplied.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-jarTypeFilteringIsApplied.gradle index a4538149be..2839b33fcd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-jarTypeFilteringIsApplied.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootWarIntegrationTests-jarTypeFilteringIsApplied.gradle @@ -4,7 +4,7 @@ plugins { } bootWar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' } repositories { 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 ec17f4aa92..86f7349a0e 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 @@ -4,7 +4,7 @@ plugins { } bootWar { - mainClassName = 'com.example.Application' + mainClass = 'com.example.Application' preserveFileTimestamps = false reproducibleFileOrder = true } 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 2ba6865c40..43b612386a 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 @@ -5,5 +5,5 @@ plugins { } springBoot { - mainClassName = 'com.example.CustomMain' + mainClass = '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 79fbe55797..32d7680985 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 @@ -4,7 +4,7 @@ plugins { } bootWar { - mainClassName = 'com.example.Application' + mainClass = '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 9a4930e3c6..06fddc9cf1 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 @@ -5,7 +5,7 @@ plugins { } bootJar { - mainClassName = 'com.example.Application' + mainClass = '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 931e2cf026..5a3b86ddff 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 @@ -5,7 +5,7 @@ plugins { } bootWar { - mainClassName = 'com.example.Application' + mainClass = '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 0e4effc0c9..4c0506b7db 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 @@ -5,7 +5,7 @@ plugins { } bootJar { - mainClassName = 'com.example.Application' + mainClass = '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 8963baa71a..cf6d104d42 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 @@ -5,7 +5,7 @@ plugins { } bootWar { - mainClassName = 'com.example.Application' + mainClass = '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-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 e2ce1837c0..f912258a07 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 @@ -4,7 +4,7 @@ plugins { } springBoot { - mainClassName = 'com.example.CustomMainClass' + mainClass = 'com.example.CustomMainClass' } task echoMainClassName {