Installing MAVEN and modifying configuration items under Windows

Source: Internet
Author: User
Tags aliyun

1. Download the website

http://maven.apache.org/download.cgi#

2. Unzip

3. Configure Environment variables

Configure the Java_home environment variables before you configure the MAVEN environment variables

Select My Computer----Right-click Properties---Advanced system settings---environment variables

3.1 New environment variable M2_home variable value: Extract the address of the file to the previous level of the bin

3.2 Add%m2_home%\bin to the PATH environment variable, as shown in the Win10 interface, if not the interface, to be added;

4. Verification

Win+r----"cmd---" input mvn-v appears as shown below, indicating successful installation

5.Maven configuration file

5.1 Modifying the Local repository

After the decompression is installed, the default repository for MAVEN is in the ${user.home}/.m2/repository file.

1. Open the Settings.xml in the Conf folder, find <localRepository> Remove comments, modify the content to the new warehouse directory (for example: My new warehouse address is: E:\Maven\repository). Create a new warehouse directory before modifying the configuration file

2. Updating the Local warehouse

Win+r----"cmd---" Input mvn help:system

Maven puts the new jar package into the modified path

5.2 Configuring the MAVEN image Warehouse

Most of the jar packages will be wall-down, and configuring a mirrored warehouse can be a good solution to this problem

Find <mirrors> in Settings.xml, recommended configuration of Ali's Mirror station, paste the following code overlay can be

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

Installing MAVEN and modifying configuration items under Windows

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.