Maven installation and Maven Installation

Source: Internet
Author: User
Tags aliyun

Maven installation and Maven Installation

1. First download apache-maven-3.3.9-bin.zip and decompress it;

2. The portable system variable maven_home. the value is the decompression path of apache-maven-3.3.9-bin.zip:

Add the following in the path variable:

%MAVEN_HOME%\bin;

3. Enter the command mvn-version to check whether the installation is successful:

4. Edit % MAVEN_HOME %/conf/settings. xml and specify the path of the local library in the file:

<localRepository>E:\m2\repository</localRepository>

When building a Maven project, Maven first searches for resources from the local database. If the local database does not exist, Maven downloads resources from the remote database to the local database, the next time you use it, you do not need to download it from the remote database.

Configure mirror:

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

The mirror is equivalent to an interceptor that redirects requests to remote repositories to the address specified by mirror. The code above redirects requests to central to http://maven.aliyun.com/nexus/content/groups/public /.

5. In Eclipse, choose Windows> Preferences> Maven> Installations, Add the newly installed Maven, and set it to the newly installed Maven:

In this way, Maven can be used in Eclipse.

Related Article

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.