Maven Concepts - Lifecycle: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 18: Line 18:
There are three built-in lifecycles: ''default'', ''clean'' and ''site''. The ''default'' lifecycle handles artifact building and deployment, and [[#Default_Lifecycle_Phases|these are its phases]]. The ''clean'' lifecycle cleans the work area by [[#Clean_Lifecycle_Phases|executing the following  phases]]. The ''site'' lifecycle handles the creation of the project's site documentation.
There are three built-in lifecycles: ''default'', ''clean'' and ''site''. The ''default'' lifecycle handles artifact building and deployment, and [[#Default_Lifecycle_Phases|these are its phases]]. The ''clean'' lifecycle cleans the work area by [[#Clean_Lifecycle_Phases|executing the following  phases]]. The ''site'' lifecycle handles the creation of the project's site documentation.


A lifecycle is defined by a sequence of build [[#Phases|phases]].
A lifecycle is defined by a sequence of build [[#Phases|phases]]. The phases are executed sequentially.


=Plugin Goal=
=Plugin Goal=

Revision as of 18:10, 18 November 2016

External

Internal

Overview

Maven Lifecycle.png

Lifecycle

A Maven lifecycle represents the clearly defined sequence of steps required for building and distributing a project artifact.

There are three built-in lifecycles: default, clean and site. The default lifecycle handles artifact building and deployment, and these are its phases. The clean lifecycle cleans the work area by executing the following phases. The site lifecycle handles the creation of the project's site documentation.

A lifecycle is defined by a sequence of build phases. The phases are executed sequentially.

Plugin Goal

A plugin goal

Phases

A Maven phase represents a stage in a lifecycle.

Default Lifecycle Phases

validate

The phase validates whether the project is correct and all necessary information is available.

initialize

generate-sources

process-sources

generate-resources

process-resources

compile

The phase compiles the source code.

process-classes

generate-test-sources

process-test-sources

generate-test-resources

process-test-resources

test-compile

process-test-classes

test

The phase tests the compiled source code by using a suitable test framework. The tests should not require the code to be packaged or deployed.

prepare-package

package

The phase packaged the compiled code in a distributable format. Also see <packaging>.

If using the assembly plugin, this is usually the phase where the plugin's "single" goal is associated with.

pre-integration-test

integration-test

post-integration-test

verify

install

The phase Installs the packaged artifact into the local repository.

deploy

The phase copies the packaged artifact to a remote repository.

Clean Lifecycle Phases