diff --git a/spring-boot-docs/src/main/asciidoc/getting-started.adoc b/spring-boot-docs/src/main/asciidoc/getting-started.adoc index 49f82cde2c..9b179aba9b 100644 --- a/spring-boot-docs/src/main/asciidoc/getting-started.adoc +++ b/spring-boot-docs/src/main/asciidoc/getting-started.adoc @@ -654,6 +654,11 @@ To create an executable jar we need to add the `spring-boot-maven-plugin` to our ---- +NOTE: The `spring-boot-starter-parent` POM includes `` configuration to +bind the `repackage` goal. If you are not using the parent POM you will need to declare +this configuration yourself. See the {spring-boot-maven-plugin-site}/usage.html[plugin +documentation] for details. + Save your `pom.xml` and run `mvn package` from the command line: [indent=0,subs="attributes"] diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index 169a453e0f..61a77dde5e 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -1340,6 +1340,52 @@ third-party dependencies. Overriding versions may cause compatibilty issues. +[[howto-create-an-executable-jar-with-maven]] +=== Create an executable JAR with Maven +The `spring-boot-maven-plugin` can be used to create an executable ``fat'' JAR. If you +are using the `spring-boot-starter-parent` POM you can simply declare the plugin and +your jars will be repackaged: + +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + + + org.springframework.boot + spring-boot-maven-plugin + + + +---- + +If you are not using the parent POM you can still use the plugin, however, you must +additionally add an `` section: + +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + + + org.springframework.boot + spring-boot-maven-plugin + {spring-boot-version} + + + + repackage + + + + + + +---- + +See the {spring-boot-maven-plugin-site}/usage.html[plugin documentation] for full usage +details. + + + [[howto-remote-debug-maven-run]] === Remote debug a Spring Boot application started with Maven To attach a remote debugger to a Spring Boot application started with Maven you can use