Polish "Add system properties support using explicit configuration tag"
Closes gh-10741pull/12955/head
parent
ba34bf6470
commit
03539d8e16
@ -0,0 +1,59 @@
|
||||
-----
|
||||
Using System Properties
|
||||
-----
|
||||
Stephane Nicoll
|
||||
-----
|
||||
2018-04-24
|
||||
-----
|
||||
|
||||
System properties can be specified using the <<<systemPropertyVariables>>> attribute.
|
||||
The following sets <<<property1>>> to <<<test>>> and <<<property2>>> to 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>
|
||||
<systemPropertyVariables>
|
||||
<property1>test</property1>
|
||||
<property2>${my.value}</property2>
|
||||
</profiles>
|
||||
</configuration>
|
||||
...
|
||||
</plugin>
|
||||
...
|
||||
</plugins>
|
||||
...
|
||||
</build>
|
||||
...
|
||||
</project>
|
||||
---
|
||||
|
||||
If the value is empty or not defined (i.e. <<<<my-property/>>>>), the system property
|
||||
is set with an empty String as the value.
|
||||
|
||||
Any String typed Maven variable can be passed as system properties. Any attempt to pass
|
||||
any other Maven variable type (e.g. a <<<List>>> or a <<<URL>>> variable) will cause the
|
||||
variable expression to be passed literally (unevaluated).
|
||||
|
||||
The <<<jvmArguments>>> parameter takes precedence over system properties defined with
|
||||
the mechanism above. In the following example, the value for <<<property1>>> is
|
||||
<<<overridden>>>:
|
||||
|
||||
|
||||
---
|
||||
mvn spring-boot:run -Dspring-boot.jvmArguments="-Dproperty1=overridden"
|
||||
---
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue