execute phase
The “execute-phase” goal is basically the same as the goal, except it accepts maven lifecycle phases instead of plugin goals. See the goal docs for more information.
What It Does
This goal maps your commands to the full set of recognized maven lifecycle phases. This goal will allow you to type “mvn package” and all the typical lifecycle events will be run up and through package. Contrastingly, the “” goal of this plugin will not allow you to run “package” because package is not a plugin, but rather a lifecycle goal.
Command Line Syntax
The command line syntax is very similar to the way arguments passed to the mvn command are interpreted, with one exception, you can specify modules. So, specifying:
maven2> clean install -Dmaven.test.skip=true -ois equivalent to running:
$ mvn clean install -Dmaven.test.skip=true -oSimilarly, goals can be executed:
maven2> dependency:treeis equivalent to running:
$ mvn dependency:treeWhen modules are specified, this is equivalent to changing into the module first. So running:
maven2> mymodule/mysubmodule clean installis equivalent to running:
$ cd mymodule/mysubmodule$ mvn clean installMultiple modules can be specified, this is equivalent to running each command on each module:
maven2> mymodule/mysubmodule1 mymodule2 clean installis equivalent to running:
$ cd mymodule/mysubmodule1$ mvn clean install$ cd ../..$ cd mymodule2$ mvn clean installFinally, different goals can be executed on different modules in the one command:
maven2> mymodule1 clean install -Dmaven.test.skip=true mymodule2 packageis equivalent to running:
$ cd mymodule1$ mvn clean install -Dmaven.test.skip=true$ cd ..$ cd mymodule2$ mvn packageOf course, aliases still work as for the goal.
Supported Options
Option Description -o
Offline mode -N
Do not recursively execute lifecycle phases -S
Shorthand for -Dmaven.test.skip=true
-Dkey=value
Specifies a property (you can specify a value with whitespace by quoting it: -Dkey="value1 value2"
-Pprofile
Specifies a profile to use