System properties can be specified using the systemPropertyVariables attribute. The following sets property1 to test and property2 to 42:


If the value is empty or not defined (i.e. <my-property/>), the system property is set with an empty String as the value. Maven trims values specified in the pom so it is not possible to specify a System property which needs to start or end with a space via this mechanism: consider using jvmArguments instead.

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"