Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following lists all build phases of the default, clean and site lifecycle, which are executed in the order given
up to the point of the one specified.

Clean Lifecycle

pre-clean

executes processes needed prior to the actual project cleaning

clean

remove all files generated by the previous build

post-clean

executes processes needed to finalize the project cleaning

Default "build" Lifecycle

validate

validate the project is correct and all necessary information is available.

initialize

initializes the build process

generate-sources

generate any source code for inclusion in compilation.

process-sources

process the source code, for example to filter any values.

generate-resources

generate resources for inclusion in the package.

process-resources

copy and process the resources into the destination directory, ready for packaging.

compile

compile the source code of the project.

process-classes

post-process the generated files from compilation, for example to do bytecode enhancement on Java classes.

generate-test-sources

generate any test source code for inclusion in compilation.

process-test-sources

process the test source code, for example to filter any values.

generate-test-resources

create resources for testing.

process-test-resources

copy and process the resources into the test destination directory.

test-compile

compile the test source code into the test destination directory

test

run tests using a suitable unit testing framework. These tests should not require the code be packaged or deployed.

package

take the compiled code and package it in its distributable format, such as a JAR.

pre-integration-test

perform actions required before integration tests are executed. This may involve things such as setting up the required environment.

integration-test

process and deploy the package if necessary into an environment where integration tests can be run.

post-integration-test

perform actions required after integration tests have been executed. This may including cleaning up the environment.

verify

run any checks to verify the package is valid and meets quality criteria.

install

install the package into the local repository, for use as a dependency in other projects locally.

deploy

done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

Site Lifecycle

pre-site

executes processes needed prior to the actual project site generation

site

generates the project's site documentation

post-site

executes processes needed to finalize the site generation, and to prepare for site deployment

site-deploy

deploys the generated site documentation to the specified web server

Furthermore, some phases have goals binded to it by default. And for the default lifecycle, the bindings depends on
the packaging value. Here are some of the build-phase-to-goal bindings.

Lifecycle Default Bindings Reference

Clean Lifecycle Bindings

clean

clean:clean

Default Lifecycle Bindings - EJB / EJB3 / JAR / PAR / RAR / WAR Packaging

process-resources

resources:resources

compile

compiler:compile

process-test-resources

resources:testResource

test-compile

compiler:testCompile

test

surefire:test

package

ejb:ejb or ejb3:ejb3 or jar:jar or par:par or rar:rar or war:war

install

install:install

deploy

deploy:deploy

Default Lifecycle Bindings - EAR Packaging

generate-resources

ear:generateApplicationXml

process-resources

resources:resources

package

ear:ear

install

install:install

deploy

deploy:deploy

Default Lifecycle Bindings - maven-plugin Packaging

generate-resources

plugin:descriptor

process-resources

resources:resources

compile

compiler:compile

process-test-resources

resources:testResource

test-compile

compiler:testCompile

test

surefire:test

package

jar:jar and plugin:addPluginArtifactMetadata

install

install:install and plugin:updateRegistry

deploy

deploy:deploy

Default Lifecycle Bindings - POM Packaging

package

site:attach-descriptor

install

install:install

deploy

deploy:deploy

Site Lifecycle Bindings

site

site:site

site-deploy

site:deploy