From 1b172dc4fea0f4182772f8ac648ddd455d80ae05 Mon Sep 17 00:00:00 2001 From: Tomas Aschan <1550920+tomasaschan@users.noreply.github.com> Date: Wed, 29 May 2019 14:59:31 +0200 Subject: [PATCH] Clarify documentation about specifying main class See gh-17003 --- .../src/main/asciidoc/build-tool-plugins.adoc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc index 0581f9df60..05969b3c2e 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc @@ -116,10 +116,21 @@ the usual `packaging` element, as shown in the following example: ---- Your existing archive is enhanced by Spring Boot during the `package` phase. The main -class that you want to launch can be specified either by using a configuration option or -by adding a `Main-Class` attribute to the manifest in the usual way. If you do not specify -a main class, the plugin searches for a class with a -`public static void main(String[] args)` method. +class that you want to launch can be specified either by using a configuration option, as +shown below, or by adding a `Main-Class` attribute to the manifest. If you do not specify +a main class, the plugin searches for a class with a `public static void main(String[] args)` +method. +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + org.springframework.boot + spring-boot-maven-plugin + + com.example.app.Main + + +---- + To build and run a project artifact, you can type the following: