HOWTO The maven mvn Command


The mvn Command
===============
The mvn command is actually a script 
Linux: bash
Windows: bat
mvn -h or mvn --usage for CLI options
usage: maven [options] [<goal(s)>] [<phase(s)>]


Options:
 -C,--strict-checksums         Fail the build if checksums don't match
 -c,--lax-checksums            Warn if checksums don't match
 -P,--activate-profiles        Comma-delimited list of profiles to
                               activate
 -ff,--fail-fast               Stop at first failure in reactorized builds
 -fae,--fail-at-end            Only fail the build afterwards; allow all
                               non-impacted builds to continue
 -B,--batch-mode               Run in non-interactive (batch) mode
 -fn,--fail-never              NEVER fail the build, regardless of project
                               result
 -up,--update-plugins          Synonym for cpu
 -N,--non-recursive            Do not recurse into sub-projects
 -npr,--no-plugin-registry     Don't use ~/.m2/plugin-registry.xml for
                               plugin versions
 -U,--update-snapshots         Update all snapshots regardless of
                               repository policies
 -cpu,--check-plugin-updates   Force upToDate check for any relevant
                               registered plugins
 -npu,--no-plugin-updates      Suppress upToDate check for any relevant
                               registered plugins
 -D,--define                   Define a system property
 -X,--debug                    Produce execution debug output
 -e,--errors                   Produce execution error messages
 -f,--file                     Force the use of an alternate POM file.
 -h,--help                     Display help information
 -o,--offline                  Work offline
 -r,--reactor                  Execute goals for project found in the
                               reactor
 -s,--settings                 Alternate path for the user settings file
 -v,--version                  Display version information
All downloads have checksums (you can enable or disable using them)
Profiles allow to change operational parameters depending on the circumstances
Other options are for specific plugins, not for the core
Set in project.xml or ~/.m2/settings.xml
Given as Java system property using -Dproperty=value


=============================================
=============================================
Maven 2 command line options
The command line options can be obtained with:
mvn --help.
Here is output for maven 2.0.4:


usage: mvn [options] [<goal(s)>] [<phase(s)>]


Options:
-C,--strict-checksums         Fail the build if checksums don't match
-c,--lax-checksums            Warn if checksums don't match
-P,--activate-profiles        Comma-delimited list of profiles to
                           activate
-ff,--fail-fast               Stop at first failure in reactorized builds
-fae,--fail-at-end            Only fail the build afterwards; allow all
                           non-impacted builds to continue
-B,--batch-mode               Run in non-interactive (batch) mode
-fn,--fail-never              NEVER fail the build, regardless of project
                           result
-up,--update-plugins          Synonym for cpu
-N,--non-recursive            Do not recurse into sub-projects
-npr,--no-plugin-registry     Don't use ~/.m2/plugin-registry.xml for
                           plugin versions
-U,--update-snapshots         Update all snapshots regardless of
                           repository policies
-cpu,--check-plugin-updates   Force upToDate check for any relevant
                           registered plugins
-npu,--no-plugin-updates      Suppress upToDate check for any relevant
                           registered plugins
-D,--define                   Define a system property
-X,--debug                    Produce execution debug output
-e,--errors                   Produce execution error messages
-f,--file                     Force the use of an alternate POM file.
-h,--help                     Display help information
-o,--offline                  Work offline
-r,--reactor                  Execute goals for project found in the
                           reactor
-s,--settings                 Alternate path for the user settings file
-v,--version                  Display version information


Resources:

  1. http://jan.baresovi.cz/dr/en/maven
  2. http://cvs.peopleware.be/training/maven/maven2/mvnCommand.html

No comments:

Post a Comment