From a666919acf00b055bef17a6eb3caf96100ca5e5e Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 6 Jun 2017 10:42:30 +0100 Subject: [PATCH] Increase prominence of warning about fully-executable jar compatibility Closes gh-8927 --- .../src/main/asciidoc/deployment.adoc | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/deployment.adoc b/spring-boot-docs/src/main/asciidoc/deployment.adoc index f21e39433d..3b661a1e90 100644 --- a/spring-boot-docs/src/main/asciidoc/deployment.adoc +++ b/spring-boot-docs/src/main/asciidoc/deployment.adoc @@ -449,8 +449,17 @@ of this guide. [[deployment-install]] == Installing Spring Boot applications In additional to running Spring Boot applications using `java -jar` it is also possible -to make fully executable applications for Unix systems. This makes it very easy to install -and manage Spring Boot applications in common production environments. +to make fully executable applications for Unix systems. A fully executable jar can be +executed like any other executable binary or it can be <>. This makes it very easy to install and manage Spring Boot +applications in common production environments. + +WARNING: Fully executable jars work by embedding an extra script at the front of the +file. Currently, some tools do not accept this format so you may not always be able to +use this technique. For example, `jar -xf` may silently fail to extract a jar or war that +has been made fully-executable. It is recommended that you only make your jar or war +fully executable if you intened to execute it directly, rather than running it with +`java -jar` or deploying it to a servlet container. To create a '`fully executable`' jar with Maven use the following plugin configuration: @@ -465,7 +474,7 @@ To create a '`fully executable`' jar with Maven use the following plugin configu ---- -With Gradle, the equivalent configuration would be: +With Gradle, the equivalent configuration is: [source,groovy,indent=0,subs="verbatim,quotes,attributes"] ---- @@ -475,19 +484,15 @@ With Gradle, the equivalent configuration would be: ---- You can then run your application by typing `./my-application.jar` (where -`my-application` is the name of your artifact). +`my-application` is the name of your artifact). The directory containing the +jar will be used as your application's working directory. -NOTE: Fully executable jars work by embedding an extra script at the front of the file. -Not all tools currently accept this format so you may not always be able to use this -technique. - -NOTE: The default script supports most Linux distributions and is tested on CentOS and +[[deployment-install-supported-operating-systems]] +=== Supported operating systems +The default script supports most Linux distributions and is tested on CentOS and Ubuntu. Other platforms, such as OS X and FreeBSD, will require the use of a custom `embeddedLaunchScript`. -NOTE: When a fully executable jar is run, it uses the jar's directory as the working -directory. - [[deployment-service]]