Maven domestic source settings-Oschina domestic source expired, don't update
Recently in writing a spring4.x + springmvc+mybatis 0 configuration article, using the source with the company's private warehouse, but in order to allow others to download the code on their own computer to run, so I changed to the source of Oschina, now a lot of articles online, said this source easy to use, more convenient, the result of the update source, has been waiting for the state, I thought I was wrong, all kinds of Google (did not listen to the wrong, is Google, our company can be used), Baidu to check the problem, the result is still not. Then I opened the source address through the browser, the result is not open, I try to the JBoss and MAVEN official source address to open the browser, found that it can be opened normally. Later on the Internet to find the reason, found that the source of the Oschina closed, but also have their official article said with the Sky Wing cloud cooperation, and can open, the result is still not open. It's all a pit. In view of the instability and unfriendly nature of the Oschina China Maven Source, I decided to write this article to remind you not to use the Oschina Maven China source, or to use the official bar. If you configure the Oschina Maven China source, the result is a problem and hurry back, let me tell you this:
1. Configure the Setting.xml file for the MAVEN project
No matter which ide,eclipse or idea you use, first you have to modify the maven corresponding Setting.xml file, mainly in the file <mirrors> tag to add a normal source address, and must remember that you will be <url> The address of the label is opened in a browser to see if it can be accessed. If you cannot access it, do not configure it. Below is my setting.xml file <mirrors> tag configuration:
The <mirrors> label means a mirrored warehouse that can be equipped with multiple. As a result of domestic unreliable and unstable, or the original good.
<mirrors>
<mirror>
<id>alimaven</id>
<mirrorof>central</mirrorof >
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/ public/</url>
</mirror>
<mirror>
<id>ui</id>
<mirrorOf> central</mirrorof>
<name>human readable name for this mirror.</name>
<url>http:// uk.maven.org/maven2/</url>
</mirror>
<mirror>
<id> jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>jboss Public Repository group</name>
<url>http://repository.jboss.org/nexus/content/groups/public< /url>
</mirror>
</mirrors>
Of course, you'd better configure the local warehouse, and if you've already configured it, don't worry. The purpose is to unify so that the MAVEN default local warehouse does not match the IDE tool configuration.
<localRepository>/Users/admin/.m2/repository</localRepository>
Then configure the warehouse address in your project Pom.xml file:
<!--repositories node is a central repository that configures maven download jars, the default is foreign, download is incredibly slow, recommend using yourself to build Sonatype Nexus Central Warehouse--> <repositories>
<repository> <id>central</id> <name>central repository</name> <url>http://repo1.maven.org/maven2/</url> <snapshots> <enable
d>false</enabled> </snapshots> </repository> <repository>
<id>jboss-public-repository-group</id> <name>jboss Public Repository group</name> <url>http://repository.jboss.org/nexus/content/groups/public/</url> <layout>defau lt</layout> <releases> <enabled>true</enabled> <upd atepolicy>never</updatepolicy> </releases> <snapshots> <en Abled>true</enabled> <updatePolicy>never</updatePolicy> </snapshots> </repositor y> <repository> <id>jboss-deprecated</id> <name>jboss deprecate
D</name> <url>https://repository.jboss.org/nexus/content/repositories/deprecated/</url> <layout>default</layout> <releases> <enabled>true</enabled&
Gt
<updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository>
; <id>jboss-maven2-brew</id> <name>jboss Maven 2 brew repository</name> <
Url>http://repository.jboss.org/maven2-brew/</url> <layout>default</layout> <releases> <enabled>true</enabled> <updatepolicy>never< ;/updatepolicy> </releases> <snapshots> <enabled>false</en abled> </snapshots> </repository> <repository> <id>io. Spring.repo.maven.release</id> <url>http://repo.spring.io/release/</url> <sna
pshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>io.spring.repo.maven.milestone</id> <url>http://
Repo.spring.io/milestone/</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories>
If you configure the Aliyun maven address in the first step, then you don't need to configure the <repository> tab above, because for now, Aliyun's MAVEN address is the most appropriate.
Hint: The above configuration is my own machine on the test, absolutely reliable, the time is about August 10, 2016, if you want to configure, or recommend to use the browser to visit these several addresses, see if you can visit, and then look at that visit quickly, priority put that to the front.