Skip to content

Commit a666919

Browse files
committed
Increase prominence of warning about fully-executable jar compatibility
Closes gh-8927
1 parent 3aaf5b6 commit a666919

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

spring-boot-docs/src/main/asciidoc/deployment.adoc

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,17 @@ of this guide.
449449
[[deployment-install]]
450450
== Installing Spring Boot applications
451451
In additional to running Spring Boot applications using `java -jar` it is also possible
452-
to make fully executable applications for Unix systems. This makes it very easy to install
453-
and manage Spring Boot applications in common production environments.
452+
to make fully executable applications for Unix systems. A fully executable jar can be
453+
executed like any other executable binary or it can be <<deployment-service,registered
454+
with `init.d` or `systemd`>>. This makes it very easy to install and manage Spring Boot
455+
applications in common production environments.
456+
457+
WARNING: Fully executable jars work by embedding an extra script at the front of the
458+
file. Currently, some tools do not accept this format so you may not always be able to
459+
use this technique. For example, `jar -xf` may silently fail to extract a jar or war that
460+
has been made fully-executable. It is recommended that you only make your jar or war
461+
fully executable if you intened to execute it directly, rather than running it with
462+
`java -jar` or deploying it to a servlet container.
454463

455464
To create a '`fully executable`' jar with Maven use the following plugin configuration:
456465

@@ -465,7 +474,7 @@ To create a '`fully executable`' jar with Maven use the following plugin configu
465474
</plugin>
466475
----
467476

468-
With Gradle, the equivalent configuration would be:
477+
With Gradle, the equivalent configuration is:
469478

470479
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
471480
----
@@ -475,19 +484,15 @@ With Gradle, the equivalent configuration would be:
475484
----
476485

477486
You can then run your application by typing `./my-application.jar` (where
478-
`my-application` is the name of your artifact).
487+
`my-application` is the name of your artifact). The directory containing the
488+
jar will be used as your application's working directory.
479489

480-
NOTE: Fully executable jars work by embedding an extra script at the front of the file.
481-
Not all tools currently accept this format so you may not always be able to use this
482-
technique.
483-
484-
NOTE: The default script supports most Linux distributions and is tested on CentOS and
490+
[[deployment-install-supported-operating-systems]]
491+
=== Supported operating systems
492+
The default script supports most Linux distributions and is tested on CentOS and
485493
Ubuntu. Other platforms, such as OS X and FreeBSD, will require the use of a custom
486494
`embeddedLaunchScript`.
487495

488-
NOTE: When a fully executable jar is run, it uses the jar's directory as the working
489-
directory.
490-
491496

492497

493498
[[deployment-service]]

0 commit comments

Comments
 (0)