MVN multi mirrors downloaded from multiple locations

Source: Internet
Author: User
Tags soapui

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.

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.