Document spring-boot.run.arguments behaviour with multiple arguments
Closes gh-19998
This commit is contained in:
parent
5f584101c6
commit
765b2178d1
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -145,7 +145,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
|
|||
* quotes. When specified, takes precedence over {@link #arguments}.
|
||||
* @since 2.2.3
|
||||
*/
|
||||
@Parameter(property = "spring-boot.run.arguments", readonly = true)
|
||||
@Parameter(property = "spring-boot.run.arguments")
|
||||
private String commandlineArguments;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
-----
|
||||
Using Application Arguments
|
||||
-----
|
||||
Stephane Nicoll
|
||||
-----
|
||||
2020-02-11
|
||||
-----
|
||||
|
||||
Application arguments can be specified using <<<arguments>>>. The following sets two
|
||||
arguments: <<<property1>>> and <<<property2=42>>>:
|
||||
|
||||
---
|
||||
<project>
|
||||
...
|
||||
<build>
|
||||
<properties>
|
||||
<my.value>42</my.value>
|
||||
</properties>
|
||||
...
|
||||
<plugins>
|
||||
...
|
||||
<plugin>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${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>>>:
|
||||
|
||||
---
|
||||
mvn spring-boot:run -Dspring-boot.run.arguments="property1 'property2=Hello World'"
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
|
@ -58,6 +58,8 @@ Spring Boot Maven Plugin
|
|||
|
||||
* {{{./examples/run-env-variables.html}Using environment variables}}
|
||||
|
||||
* {{{./examples/run-arguments.html}Using application arguments}}
|
||||
|
||||
* {{{./examples/it-random-port.html}Random port for integration tests}}
|
||||
|
||||
* {{{./examples/it-skip.html}Skip integration tests}}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<item name="Debug the application" href="examples/run-debug.html"/>
|
||||
<item name="Using system properties" href="examples/run-system-properties.html"/>
|
||||
<item name="Using environment variable" href="examples/run-env-variables.html"/>
|
||||
<item name="Using application arguments" href="examples/run-arguments.html"/>
|
||||
<item name="Random port for integration tests" href="examples/it-random-port.html"/>
|
||||
<item name="Skip integration tests" href="examples/it-skip.html"/>
|
||||
<item name="Specify active profiles" href="examples/run-profiles.html"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue