First, MVN is similar to ant. All are compilation project + packaging. Many open-source software are used. These open-source software has a large number of third-party dependencies. Unfortunately, these third-party dependencies are likely to be in many repository. Search for stackoverflow and find that most of the answers are as follows:
Write in CONF/setting. xml:
<mirrors> <mirror> <id>UK</id> <name>UK Central</name> <url>http://uk.maven.org/maven2</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors>
This adds one.
<mirrors> <mirror> <id>UK</id> <name>UK Central</name> <url>http://uk.maven.org/maven2</url> <mirrorOf>central</mirrorOf> </mirror><mirror> <id>nexus-central</id> <name>internal nexus repository</name> <url>http://nexus.corp.youdao.com/nexus/content/repositories/public/</url><mirrorOf>central</mirrorOf> </mirror> <mirror> <id>soap</id> <name>internal nexus repository</name> <url>http://www.soapui.org/repository/maven2</url><mirrorOf>!UK,*</mirrorOf> </mirror> </mirrors>
In this way, add two.
This is the answer to stackoverflow. If you add the following three items:
<mirrors> <mirror> <id>UK</id> <name>UK Central</name> <url>http://uk.maven.org/maven2</url> <mirrorOf>central</mirrorOf> </mirror><mirror> <id>nexus-central</id> <name>internal nexus repository</name> <url>http://nexus.corp.youdao.com/nexus/content/repositories/public/</url><mirrorOf>central</mirrorOf> </mirror> <mirror> <id>soap</id> <name>internal nexus repository</name> <url>http://www.soapui.org/repository/maven2</url><mirrorOf>!UK,*</mirrorOf> </mirror><mirror> <id>nightlabs</id> <name>internal nexus repository</name> <url>http://dev.nightlabs.org/maven-repository/maven.jahia.org-cache/</url><mirrorOf>!UK,!soap,*</mirrorOf> </mirror> </mirrors>
Sorry... the answer is wrong .....
Therefore, three or more methods are as follows:
<mirrors> <mirror> <id>UK</id> <name>UK Central</name> <url>http://uk.maven.org/maven2</url> <mirrorOf>central</mirrorOf> </mirror><mirror> <id>nexus-central</id> <name>internal nexus repository</name> <url>http://nexus.corp.youdao.com/nexus/content/repositories/public/</url><mirrorOf>central</mirrorOf> </mirror> <mirror> <id>soap</id> <name>internal nexus repository</name> <url>http://www.soapui.org/repository/maven2</url><mirrorOf>!UK,central</mirrorOf> </mirror><mirror> <id>nightlabs</id> <name>internal nexus repository</name> <url>http://dev.nightlabs.org/maven-repository/maven.jahia.org-cache/</url><mirrorOf>!UK,!soap,central</mirrorOf> </mirror> </mirrors>
Change * to Central, because MVN won't continue to do anything later. Although the official Apache documentation says there can only be one central, there can actually be multiple! Central of mirrorid.