The following command line options are available when running Maven:
usage: maven [options] [goal [goal2 [goal3] ...]] Options: -D,--define arg Define a system property -E,--emacs Produce logging information without adornments -P,--plugin-help Display help on using a given plugin -X,--debug Produce execution debug output -b,--nobanner Suppress logo banner -d,--dir arg Set effective working directory (ignored with -p or -f) -e,--exception Produce exception stack traces -f,--find arg Set project file and effective working directory by finding the project file -g,--goals Display available goals -h,--help Display help information -i,--info Display system information -o,--offline Build is happening offline -p,--pom arg Set project file -q,--quiet Reduce execution output -u,--usage Display help on using the current project -v,--version Display version information
Typically, Maven is run with a list of goals in the order they should be executed.
If no goals are specified, the default goal specified in
Additionally, the following switches can be specified. Note that
cause Maven to exit immediately without running any goals given.
Defines a system property. This will take priority over any other property specified.
|-E||Output messages without adornments, making it more suitable for use in emacs.|
Get help with plugins. When used without any arguments, ie.
|-X||Output full debugging information while performing the build. This can be helpful in tracing what is happening inside a plugin, or sending information to the Maven Developers about an internal bug.|
|-b||Don't show the ASCII Art banner.|
|-d||Set the effective working directory for running Maven in.|
|-e||Display the stack trace for any final exception that leads to a build failure.|
Set the effective working directory for running Maven in by searching for the closest
List all goals available, both in this project and all installed plugins. Best used with
|-h||List the help commands above.|
Show system information. Lists environment properties such as the Java version, all installed plugins
and their versions, and the user's
Run in offline mode. This is equivalent to specifying the property
Specify the project file to use. By default it is
|-q||Run in quiet mode. Only errors are output. Note that some plugins do not honour this option, so it should not be considered as a silent mode.|
Show the usage instructions for the current project. This will include the goals specified in
|-v||Show the Maven version and exit.|
Specify additional options using the
MAVEN_OPTS environment variable.
It is for passing parameters to the Java VM when running Maven.
For example, to increase the amount of memory to 1024 Meg for the entire run of Maven, use:
Also note that a given plug-in may have a property to set for its memory usage,
such as the Javadoc plug-in's
This is because that particular plugin forks an additional Java VM.
For another example, set the MAVEN_OPTS to run Java in debug mode:
After setting this property, run "maven cactus:test" (or whatever goal to debug) and it will block, waiting for a debug connection.
Then, in your IDE, select the "Run -> Debug" window and craete a new "Remote Java Application" configuration, passing the port set in MAVEN_OPTS (8787 in this case).
Once running this configuration in debug, the blocked Maven session will continue, enabling debugging from your IDE.