Maven Introductory Learning

Source: Internet
Author: User

One,maven basic command

Two, coordinates, components and warehouses

1, coordinates and components

GroupId: Company URL anti-write + project name

Artifactid: Project name - module name

2, Warehouse

Local Warehouse

Remote Global central repository :

3, mirrored warehouse

Settings. xml <mirror> modifications

4. Change the local default warehouse path

Third, install the maven plugin in Eclipse

First step: Modify the Eclipse. ini

Step Two: Modify the JDK used

Part III: Modifying the use of local maven plugins

Test:

(1) Create a maven project

(2) build projects quickly and automatically

(3) Create a project package

Compile:

The same is true for packaging tests.

Four,maven life cycle and plugins

Project Build Process:

Life cycle:

Many of the commands in Mavan are integrated with each plug-in, and theApachemaven website provides many of the plugins that Maven needs for each lifecycle.

Examples of using plug-ins:

Using maven 's resource plugin, this plugin is a package that packages the project source into jars during package packaging .

Five,Pom. xml parsing

VI, Reliance

Range

Modify The default JRE for Eclipse

Dependency passing:a-b,b-c, then C will be added to the path of C when compiling a , you can use excusion to remove this indirect dependency.

Polymerization

Inherited

The Specific information of JUnit is inherited from the parent pom

Seven. construct a Web project using maven

Junit changed to 4.

Check the class file output path:

To convert a maven project into a web project:

To modify the configuration when a project is deployed:

Add jetty plugin:

Then maven build jetty: Run the Web project

Maven Introductory Learning

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.