------ Invoker Properties ------ Benjamin Bentmann ------ 2008-08-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 Invoker Properties The various parameters in the plugin configuration provide a means to globally configure the goals, profiles etc. used to run a Maven build on the projects. However, for certain projects you might want to specify different settings. To avoid the hassle of multiple plugin executions, you can simply use a file named <<>> to control the build settings on a per project basis. The exact name of this properties file is configurable but it needs to reside in the base directory of the respective project as shown below: +------------------ ./ +- src/ +- it/ +- test-project/ +- pom.xml +- invoker.properties +- src/ +------------------ There are only a few keys supported in this file and their names typically match the corresponding parameters in the plugin configuration. For a complete overview of supported properties, see the example given in the documentation of the plugin parameter <<<{{{../run-mojo.html#invokerPropertiesFile}invokerPropertiesFile}}>>>. The comments given in the example should be rather self-explanatory. Looking closely, you can also notice that the syntax <<<$\{expression\}>>> can be used to filter the property values. What deserves some more description is the possibility to perform several Maven builds on the same project. By default, the Invoker Plugin will perform the following steps for each project: * Run the pre build hook script if existent * Invoke Maven in the project directory * Run the post build hook script if existent [] Since plugin version 1.3, you can append a one-based index to the invoker properties in order to enable/configure further invocations of Maven. More precisely, <<>> specifies the goals for the first build, <<>> lists the goals for the second build and so on. These builds will be performed one after the other: * Run the pre build hook script if existent * Invoke Maven in the project directory * Invoke Maven in the project directory * ... * Invoke Maven in the project directory * Run the post build hook script if existent [] Most of the properties can be indexed this way, e.g. <<>> would specify the profiles to use for the third invocation. If the property <<>> was not defined, the plugin would query the property <<>> as a fallback to determine the profiles for the third build. This build loop ends after invocation if no property <<>> is defined. The invoker properties can also be used to skip projects based on the current JRE version or OS family. For more information on this feature, please see {{{./selector-conditions.html}Selector Conditions}}.