You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/running.adoc
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@ The plugin includes a run goal which can be used to launch your application from
8
8
$ mvn spring-boot:run
9
9
----
10
10
11
+
Application arguments can be specified using the `arguments` parameter, see <<run-example-application-arguments,using application arguments>> for more details.
12
+
11
13
By default the application is executed in a forked process and setting properties on the command-line will not affect the application.
12
14
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.
13
15
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
207
206
208
207
209
210
+
[[run-example-application-arguments]]
211
+
==== Using Application Arguments
212
+
Application arguments can be specified using the `arguments` attribute.
213
+
The following example sets two arguments: `property1` and `property2=42`:
214
+
215
+
[source,xml,indent=0,subs="verbatim,attributes"]
216
+
----
217
+
<project>
218
+
<build>
219
+
<plugins>
220
+
<plugin>
221
+
<groupId>org.springframework.boot</groupId>
222
+
<artifactId>spring-boot-maven-plugin</artifactId>
223
+
<version>{gradle-project-version}</version>
224
+
<configuration>
225
+
<arguments>
226
+
<argument>property1</argument>
227
+
<argument>property2=${my.value}</argument>
228
+
</arguments>
229
+
</configuration>
230
+
</plugin>
231
+
</plugins>
232
+
</build>
233
+
</project>
234
+
----
235
+
236
+
On the command-line, arguments are separated by a space the same way `jvmArguments` are.
237
+
If an argument contains a space, make sure to quote it.
238
+
In the following example, two arguments are available: `property1` and `property2=Hello World`:
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
155
155
* quotes. When specified, takes precedence over {@link #arguments}.
0 commit comments