PhaseHandles描述prepare-resourcesresource copyingResource copying can be customized in this phase.compilecompilationSource code compilation is done in this phase.packagepackagingThis phase creates the JAR / WAR package as mentioned in packaging in POM.xml.installinstallationThis phase installs the package in local / remote maven repository.
[INFO] Total time: < 1 second
[INFO] Finished at: Sat Jul 07 13:38:59 IST 2012
[INFO] Final Memory: 4M/44M
Lifecycle Phase描述validateValidates whether project is correct and all necessary information is available to complete the build process.initializeInitializes build state, for example set propertiesgenerate-sourcesGenerate any source code to be included in compilation phase.process-sourcesProcess the source code, for example, filter any value.generate-resourcesGenerate resources to be included in the package.process-resourcesCopy and process the resources into the destination directory, ready for packaging phase.compileCompile the source code of the project.process-classesPost-process the generated files from compilation, for example to do bytecode enhancement/optimization on Java classes.generate-test-sourcesGenerate any test source code to be included in compilation phase.process-test-sourcesProcess the test source code, for example, filter any values.test-compileCompile the test source code into the test destination directory.process-test-classesProcess the generated files from test code file compilation.testRun tests using a suitable unit testing framework(Junit is one).prepare-packagePerform any operations necessary to prepare a package before the actual packaging.packageTake the compiled code and package it in its distributable format, such as a JAR, WAR, or EAR file.pre-integration-testPerform actions required before integration tests are executed. For example, setting up the required environment.integration-testProcess and deploy the package if necessary into an environment where integration tests can be run.pre-integration-testPerform actions required after integration tests have been executed. For example, cleaning up the environment.verifyRun any check-ups to verify the package is valid and meets quality criterias.installInstall the package into the local repository, which can be used as a dependency in other projects locally.deployCopies the final package to the remote repository for sharing with other developers and projects.
There are few important concepts related to Maven Lifecycles which are wroth to mention:
When a phase is called via Maven command, for example mvn compile, only phases upto and including that phase will execute.
Different maven goals will be bound to different phases of Maven lifecycle depending upon the type of packaging (JAR / WAR / EAR).