Hello Maven 4-life cycle and plugins

Source: Internet
Author: User

Three independent lifecycles, dependencies within the same life cycle
Clean Lifecycle
Pre-clean
Clean
Post-clean

Default Lifecycle
Validate
Initialize
Generate-sources
Process-sources
Generate-resources
Process-resources
Compile-Compile the main code of the project
Process-classes
Generate-test-sources
Process-test-sources
Generate-test-resources
Process-test-resources
Test-compile
Process-test-classes
Test
Prepare-package
Package-accepts compiled code and packages it into a published format, such as a jar
Pre-integration-test
Integration-test
Post-integration-test
Verify
Install installs the package to the MAVEN local repository
Deploy to copy the final package to the remote repository

Site Lifecycle
Pre-site
Site
Post-site
Site-deploy-Publish the production project site to the server

Plug-in bindings
The lifecycle processes are implemented by binding plug-ins, with the default bindings see: Http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
To view the default binding phase of a plug-in
MVN Help:describe-dplugin = Org.apache.maven.plugins:maven-source-plugin:2.1.1-ddetail

Custom Bindings
In the Pom.xml

    <Build>        <Plugins>            <plugin>                <groupId>Org.apache.maven.plugins</groupId>                <Artifactid>Maven-source-plugin</Artifactid>                <version>2.1.1</version>                <executions>                    <Execution>                        <ID>Attact-sources</ID>                        <Phase>Verify</Phase>                        <Goals>                            <goal>Jar-no-fork</goal>                        </Goals>                    </Execution>                </executions>            </plugin>        </Plugins>    </Build>

Plug-in configuration
command line configuration such as mvn Install-dmaven.test.skip = True
Global configuration in Pom as

    <Build>        <Plugins>            <plugin>                    <groupId>Org.apache.maven.plugins</groupId>                    <Artifactid>Maven-compiler-plugin</Artifactid>                   <version>3.2</version>                <Configuration>                        <Source>1.7</Source>                        <Target>1.7</Target>                        <encoding>UTF-8</encoding>                </Configuration>                </plugin>        </Plugins>    </Build>

Hello Maven 4-life cycle 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.