From 69581f90da564894498363598fbb14132d013865 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 14 Oct 2015 15:00:33 +0200 Subject: [PATCH] Clarify MainClass option of the bootRepackage task Closes gh-2477 --- .../src/main/asciidoc/appendix-executable-jar-format.adoc | 4 ++++ spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc b/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc index fb5504a45d..a8f89d7b14 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc @@ -230,6 +230,10 @@ Manifest entry keys are formed by capitalizing initial letters of words and chan separator to "`-`" from "`.`" (e.g. `Loader-Path`). The exception is `loader.main` which is looked up as `Start-Class` in the manifest for compatibility with `JarLauncher`). +TIP: Build plugins automatically move the `Main-Class` attribute to `Start-Class` when +the fat jar is built. If you are using that, specify the name of the class to launch using +the `Main-Class` attribute and leave out `Start-Class`. + Environment variables can be capitalized with underscore separators instead of periods. * `loader.home` is the directory location of an additional properties file (overriding diff --git a/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc b/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc index d123839725..6b74ec7bdf 100644 --- a/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc +++ b/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc @@ -246,7 +246,8 @@ its {dependency-management-plugin-documentation}[documentation]. [[build-tool-plugins-gradle-packaging]] === Packaging executable jar and war files Once the `spring-boot` plugin has been applied to your project it will automatically -attempt to rewrite archives to make them executable using the `bootRepackage` task. You +attempt to rewrite archives to make them executable using the +<>. You should configure your project to build a jar or war (as appropriate) in the usual way. The main class that you want to launch can either be specified using a configuration @@ -254,6 +255,9 @@ option, or by adding a `Main-Class` attribute to the manifest. If you don't spec main class the plugin will search for a class with a `public static void main(String[] args)` method. +TIP: Check <> for a full list of +configuration options. + To build and run a project artifact, you can type the following: [indent=0]