Maven Introduction and Configuration

A, Ant

  Ant and Maven build tool is a project, in running the project editor packing and other processes need to rely on the Ant build tool.

Second, distributed

1, the traditional project deployment: Create a new project, through different packages to distinguish between different modules, and put a publishing project to the server.

2, the distributed project deployment: suitable for a heavy load, to a complete split into a plurality of items of the item, the items are split after deployment to the corresponding server.

Three, Maven Profile

1, Maven is an Ant-based build tool, Ant Maven has some features and additional add other functions.

2, Maven run schematics:

(1), the local repository: a computer file in a folder, its own definition.

(2), a central repository: https: //repo1.maven.org/maven2/

Question: slow download speeds

Solution: Configure the domestic Mirror

 

 3, the coordinates

  Each jar package has a unique set of coordinates, the coordinates can pinpoint which jia package.

Coordinate components:

(A), Group ID: the name of the company to write down the company's Web site.

(B), Artifact ID: project name

(C), Version: Version

View coordinates: http: //mvnrepository.com/

4、pom

  Project Object Mode, Project Object Model, the project as an object viewed through maven build tools can make between objects (projects) and the object (project) to generate relationships.

Fourth, install Maven

  Eclipse default maven plug-in installed.

Local maven installation process:

 

 

 

 Five, setting.xml configuration file

 

 1, set up a local warehouse

<localRepository>D:/Maven/repository</localRepository>

2, (Nexus configuration when not in use) to modify the address image (Ali cloud images used)

<mirror>
    <id>alimaven</id>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    <mirrorOf>central</mirrorOf>
</mirror>

3, modified version of the JDK

<profile>
    <id>jdk-1.8</id>
    <activation>
        <activeByDefault>true</activeByDefault>
        <jdk>1.8</jdk>
    </activation>
    <properties>
         <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
    </properties>
</profile>        

 

Guess you like

Origin www.cnblogs.com/wxinyi/p/12523208.html