Maven changes mirror site to China Open Source mirror Point

Source: Internet
Author: User

Download the bin file on the Apache website and extract it to the appropriate directory. Then configure/etc/profile, environment variable named M2_home, as follows: (note source/etc/profile after configuration)
#Maven
Export m2_home=/usr/local/apache-maven-3.3.1
Export path= $PATH: $M 2_home/bin
Because there are a lot of things to download at compile time, we can edit the Maven\conf\settings.xml file and change the mirror site to the Chinese open source image point as follows:
<mirrors>
<mirror>

<id>nexus-osc</id>

<mirrorOf>*</mirrorOf>

<name>Nexusosc</name>

<url>http://maven.oschina.net/content/groups/public/</url>

</mirror>
</mirrors>
and (be careful not to change this file to the wrong one)
<profiles>
<profile>
<id>jdk-1.7</id>
<activation>

<jdk>1.7</jdk>

</activation>
<repositories>

<repository>

<id>nexus</id>

<name>local Private nexus</name>

<url>http://maven.oschina.net/content/groups/public/</url>

<releases>

<enabled>true</enabled>

</releases>

<snapshots>

<enabled>false</enabled>

</snapshots>

</repository>

</repositories>

<pluginRepositories>

<pluginRepository>

<id>nexus</id>

<name>local Private nexus</name>

<url>http://maven.oschina.net/content/groups/public/</url>

<releases>

<enabled>true</enabled>

</releases>

<snapshots>

<enabled>false</enabled>

</snapshots>

</pluginRepository>

</pluginRepositories>

</profile>
</profiles>
This maven\conf\settings.xml file is then copied to the ~/.m2 folder to ensure that the user can use this configuration (. M2 is a hidden folder) every time maven is used.

Maven changes mirror site to China Open Source mirror Point

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.