Skip to content

Commit 8beb6c1

Browse files
committed
Document how to specify arguments on the command line with Maven
Closes spring-projectsgh-10926
1 parent 684d5a8 commit 8beb6c1

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ build system. If you are just getting started, you might want to read
1616

1717
[[build-tool-plugins-maven-plugin]]
1818
== Spring Boot Maven Plugin
19-
The {spring-boot-maven-plugin-site}[Spring Boot Maven Plugin] provides Spring Boot
20-
support in Maven, letting you package executable jar or war archives and run an
21-
application "`in-place`". To use it, you must use Maven 3.2 (or later).
19+
The Spring Boot Maven Plugin provides Spring Boot support in Maven, letting you package
20+
executable jar or war archives and run an application "`in-place`". To use it, you must
21+
use Maven 3.2 (or later).
2222

2323
NOTE: See the {spring-boot-maven-plugin-site}[Spring Boot Maven Plugin Site] for complete
2424
plugin documentation.

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/usage.apt.vm

+14-12
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,22 @@ Usage
130130
mvn spring-boot:run
131131
---
132132

133-
By default the application is executed in a forked process. Although this is not
134-
recommended, it is possible to execute the application directly from the Maven JVM by
135-
disabling the <<<fork>>> property. Doing so means that <<<jvmArguments>>>,
136-
<<<systemPropertyVariables>>>, <<<environmentVariables>>> and <<<agent>>> options are
137-
ignored.
138-
139-
If you need to specify some JVM arguments (i.e. for debugging purposes), you can use
140-
the <<<jvmArguments>>> parameter, see {{{./examples/run-debug.html}Debug the application}}
141-
for more details. There is also explicit support for
142-
{{{./examples/run-system-properties.html}system properties}} and
133+
By default the application is executed in a forked process and setting properties on the
134+
command-line will not affect the application. If you need to specify some JVM arguments
135+
(i.e. for debugging purposes), you can use the <<<jvmArguments>>> parameter, see
136+
{{{./examples/run-debug.html}Debug the application}} for more details. There is also
137+
explicit support for {{{./examples/run-system-properties.html}system properties}} and
143138
{{{./examples/run-env-variables.html}environment variables}}.
144139

145-
As a convenience, the profiles to enable are handled by a specific property (
146-
<<<profiles>>>), see {{{./examples/run-profiles.html}Specify active profiles}}.
140+
As enabling a profile is quite common, there is dedicated <<<profiles>>> property that
141+
offers a shortcut for
142+
<<<-Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev">>>,
143+
see {{{./examples/run-profiles.html}Specify active profiles}}.
144+
145+
Although this is not recommended, it is possible to execute the application directly
146+
from the Maven JVM by disabling the <<<fork>>> property. Doing so means that the
147+
<<<jvmArguments>>>, <<<systemPropertyVariables>>>, <<<environmentVariables>>> and
148+
<<<agents>>> options are ignored.
147149

148150
Spring Boot 1.3 has introduced <<<devtools>>>, a module to improve the development-time
149151
experience when working on Spring Boot applications. To enable it, just add the following

0 commit comments

Comments
 (0)