Under Eclipse, modify the MAVEN Central warehouse address to resolve the MAVEN download slow problem

Source: Internet
Author: User
Tags maven central aliyun

Long time do not write code, suddenly need to write a small program, Rusty, Record knowledge Points Memo:

Performance: After importing the project into the workspace, the compile-time display maven is downloading resources, but the speed is too slow to endure.


Modify Maven Central warehouse in Eclipse: 2 ways

Mode 1: (tested)

Works on all workspaces:

1. Open each item: Eclipse->preference->maven->user Settings. Follow the path shown in the User settings text box in the window, create a settings.xml file, or create a file after modifying the path.

2, close the window and reopen, click on "Open File", open the configuration file in the IDE, "could not read settings.xml" do not need to.

3, copy the following to the configuration file, where the <mirror></mirror> part is a domestic mirror.

<settings xsi:schemalocation= "http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/ Settings-1.0.0.xsd "> <mirrors> <!--Mirror | Specifies a repository mirror site to use instead of a given repository. The Repository that | This mirror serves have an ID, that matches, the mirrorof element of this mirror. IDs is used | For inheritance and direct lookup purposes, and must is unique across the set of mirrors. | -<mirror> <id>alimaven</id> <name>aliyun maven</name> <url> Http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </m irror> <mirror> <id>uk</id> <mirrorOf>central</mirrorOf> &L 
		  T;name>human readable name for this mirror.</name> <url>http://uk.maven.org/maven2/</url> </mirror> <mirror> &LT;ID&GT;CN</id> <name>oschina central</name> <url>http://maven.oschina.net/content/groups/public /</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>nex Us</id> <name>internal Nexus repository</name> <url>http://repo.maven.apache.org/maven 2</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors> <profiles> &L t;profile> <id>default</id> <repositories> <repository> &LT;ID&GT;NEXUS&LT;/ID&G
					T <name>local Private nexus</name> <url>http://maven.oschina.net/content/groups/public/</url > <releases> <enabled>true</enabled> </releases> <snapshots> & lt;enabled>false</enabled> </snapshots> </repository> </repositories> <plugin Repositories> <pluginrepository> <id>nexus</id> <name>local Private nexus</name> <url> Http://maven.oschina.net/content/groups/public/</url> <releases> <enabled>true</enabled&gt
					; </releases> <snapshots> <enabled>false</enabled> </snapshots> </plugi nrepository> </pluginRepositories> </profile> </profiles> </settings>

4, "Apply" after the configuration takes effect, recompile can.


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.