------ Using System Properties ------ Allan Ramirez Dan Tran ------ 2010-01-09 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Using System Properties There are two ways to add a list of system properties to ${thisPlugin}: * systemPropertyVariables This configuration is the replacement of the deprecated <<>>. It can accept any value from Maven's properties that can be converted <>. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} propertyValue \${project.build.directory} [...] [...] +---+ * systemProperties ( deprecated ) +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} propertyName propertyValue [...] [...] +---+ Take note that only <> properties can be passed as system properties. Any attempt to pass any other Maven variable type (i.e. <<>> or a <<>> variable) will cause the variable expression to be passed literally (unevaluated). So having the example below: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} buildDir \${project.build.outputDirectory} [...] +---+ will literally pass <<$\{project.build.outputDirectory\}>> because the value of that expression is a <<>>, not a <<>>. To inherit the "systemProperties" collection from the parent configuration, you will need to specify combine.children="append" on the systemProperties node in the child pom: +---+ [...] +---+ Special VM properties Some system properties must be set on the command line of the forked VM, and cannot be set after the VM has been started. These properties must be added to the argLine parameter of the surefire plugin. +---+ -Djava.endorsed.dirs=... +---+