axper / maven-cheatsheet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lifecycle

validatevalidate the project is correct and all necessary information is available
compilecompile the source code of the project
testtest the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
packagetake the compiled code and package it in its distributable format, such as a JAR
integration-testprocess and deploy the package if necessary into an environment where integration tests can be run
verifyrun any checks to verify the package is valid and meets quality criteria
installinstall the package into the local repository, for use as a dependency in other projects locally
deploydone in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects

Lifecycle

compilethis is the default scope, used if none is specified. Compile dependencies are available in all classpaths. Furthermore, those dependencies are propagated to dependent projects.
providedthis is much like compile, but indicates you expect the JDK or a container to provide it at runtime. It is only available on the compilation and test classpath, and is not transitive.
runtimethis scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath.
testthis scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases.
systemthis scope is similar to `provided` except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.

Specify projects

--projects -plComma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path.
--resume-from -rfResume reactor from specified project
--activate-profiles -PComma-delimited list of profiles to activate
--non-recursive-NDo not recurse into sub-projects
--also-make-amIf project list is specified, also build projects required by the list
--also-make-dependents-amdIf project list is specified, also build projects that depend on projects on the list

Main

--threads -TThread count, for instance 2.0C where C is core multiplied
--define -DDefine a system property
--batch-mode-BRun in non-interactive (batch) mode
--builder -bThe id of the build strategy to use.

Output

--quiet-qQuiet output - only show errors
--errors-eProduce execution error messages
--debug-XProduce execution debug output

Repo

--update-snapshots-UForces a check for missing releases and updated snapshots on remote repositories
--offline-oWork offline
--no-snapshot-updates-nsuSuppress SNAPSHOT updates
--legacy-local-repository-llrUse Maven 2 Legacy Local Repository behaviour, ie no use of \_remote.repositories. Can also be activated by using -Dmaven.legacyLocalRepo=true

Passwords

--encrypt-master-password -empEncrypt master security password
--encrypt-password -epEncrypt server password

Fail

--fail-at-end-faeOnly fail the build afterwards; allow all non-impacted builds to continue
--fail-fast-ffStop at first failure in reactorized builds
--fail-never-fnNEVER fail the build, regardless of project result

Checksum

--lax-checksums-cWarn if checksums don't match
--strict-checksums-CFail the build if checksums don't match

File locations

--file -fForce the use of an alternate POM file (or directory with pom.xml).
--settings -sAlternate path for the user settings file
--toolchains -tAlternate path for the user toolchains file
--log-file -lLog file to where all build output will go.
--global-settings -gsAlternate path for the global settings file
--global-toolchains -gtAlternate path for the global toolchains file

Version/Misc

--version-vDisplay version information
--show-version-VDisplay version information WITHOUT stopping build
--help-hDisplay help information

Deprecated options

--check-plugin-updates-cpuIneffective, only kept for backward compatibility
--update-plugins-upIneffective, only kept for backward compatibility
--no-plugin-registry-nprIneffective, only kept for backward compatibility
--no-plugin-updates-npuIneffective, only kept for backward compatibility

About