Commit 32291421 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge branch '2.2.x'

Closes gh-20121
parents 1306c9b7 765b2178
...@@ -8,6 +8,8 @@ The plugin includes a run goal which can be used to launch your application from ...@@ -8,6 +8,8 @@ The plugin includes a run goal which can be used to launch your application from
$ mvn spring-boot:run $ mvn spring-boot:run
---- ----
Application arguments can be specified using the `arguments` parameter, see <<run-example-application-arguments,using application arguments>> for more details.
By default the application is executed in a forked process and setting properties on the command-line will not affect the application. By default the application is executed in a forked process and setting properties on the command-line will not affect the application.
If you need to specify some JVM arguments (i.e. for debugging purposes), you can use the `jvmArguments` parameter, see <<run-example-debug,Debug the application>> for more details. If you need to specify some JVM arguments (i.e. for debugging purposes), you can use the `jvmArguments` parameter, see <<run-example-debug,Debug the application>> for more details.
There is also explicit support for <<run-example-system-properties,system properties>> and <<run-example-environment-variables,environment variables>>. There is also explicit support for <<run-example-system-properties,system properties>> and <<run-example-environment-variables,environment variables>>.
...@@ -205,6 +207,43 @@ Environment variables defined this way take precedence over existing values. ...@@ -205,6 +207,43 @@ Environment variables defined this way take precedence over existing values.
[[run-example-application-arguments]]
==== Using Application Arguments
Application arguments can be specified using the `arguments` attribute.
The following example sets two arguments: `property1` and `property2=42`:
[source,xml,indent=0,subs="verbatim,attributes"]
----
<project>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>{gradle-project-version}</version>
<configuration>
<arguments>
<argument>property1</argument>
<argument>property2=${my.value}</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</project>
----
On the command-line, arguments are separated by a space the same way `jvmArguments` are.
If an argument contains a space, make sure to quote it.
In the following example, two arguments are available: `property1` and `property2=Hello World`:
[indent=0]
----
$ mvn spring-boot:run -Dspring-boot.run.arguments="property1 'property2=Hello World'"
----
[[run-example-active-profiles]] [[run-example-active-profiles]]
==== Specify Active Profiles ==== Specify Active Profiles
The active profiles to use for a particular application can be specified using the `profiles` argument. The active profiles to use for a particular application can be specified using the `profiles` argument.
......
...@@ -155,7 +155,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo { ...@@ -155,7 +155,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
* quotes. When specified, takes precedence over {@link #arguments}. * quotes. When specified, takes precedence over {@link #arguments}.
* @since 2.2.3 * @since 2.2.3
*/ */
@Parameter(property = "spring-boot.run.arguments", readonly = true) @Parameter(property = "spring-boot.run.arguments")
private String commandlineArguments; private String commandlineArguments;
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment