Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
765b2178
Commit
765b2178
authored
Feb 11, 2020
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document spring-boot.run.arguments behaviour with multiple arguments
Closes gh-19998
parent
5f584101
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
2 deletions
+56
-2
AbstractRunMojo.java
.../java/org/springframework/boot/maven/AbstractRunMojo.java
+2
-2
run-arguments.apt.vm
...t-maven-plugin/src/site/apt/examples/run-arguments.apt.vm
+51
-0
index.apt
...oot-tools/spring-boot-maven-plugin/src/site/apt/index.apt
+2
-0
site.xml
...ing-boot-tools/spring-boot-maven-plugin/src/site/site.xml
+1
-0
No files found.
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java
View file @
765b2178
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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
;
/**
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/examples/run-arguments.apt.vm
0 → 100644
View file @
765b2178
-----
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'"
---
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/index.apt
View file @
765b2178
...
...
@@ -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}}
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/site.xml
View file @
765b2178
...
...
@@ -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"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment