Maven Getting Started tutorial three----lifecycle and plugins

Source: Internet
Author: User

    • Life cycle and plugins

MAVEN defines three sets of lifecycles: Clean, default, site, and each life cycle contains stages (phase).
The three sets of lifecycles are independent of each other, but the phase in each life cycle are sequential, and the latter phase depend on the previous phase.
When a phase is executed, the phase in front of it executes sequentially, but does not trigger any phase in the other two sets of life cycles.
Such as:

----------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------


When running any of the life cycle phases, all the life cycle phases in front of it will be run, which is why when we run MVN install, the code is compiled, tested, packaged.

    • Plug - ins

The plug-in is the core of Maven, and all of the actions are based on MAVEN operations, in order for a plugin to implement more similar functions, a plug-in
There may be multiple targets. Each phase of the lifecycle is executed by the corresponding plug-in and target, such as:

Plug-ins are configured through the build tag to specify the execution target by configuring execution and goal, and the phase of the plug-in binding is established through phase
For example:


Maven default plug-ins, so you do not need to display the configuration to perform the various stages of the Maven life cycle:

Maven Getting Started tutorial three----lifecycle and plugins

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.