Maven私服上使用自己的私服下载不了第三方jar包的问题解决

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/toto1297488504/article/details/82351459

在maven的settings.xml中添加,另外的三个mirror即可解决问题:

<mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->

        <mirror>
          <id>nexus</id>
          <mirrorOf>*</mirrorOf>
          <name>Nexus Mirror</name>
          <url>http://xxxx:8089/nexus/content/groups/public</url>
       </mirror>
        <mirror>
            <id>Nexus2</id>
            <url>http://xxxx:8089/nexus/content/groups/public</url>
            <mirrorOf>public-snapshots</mirrorOf>
        </mirror>

        <!-- 阿里云仓库 -->
        <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
        </mirror>


        <!-- 中央仓库1 -->
        <mirror>
            <id>repo1</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo1.maven.org/maven2/</url>
        </mirror>


        <!-- 中央仓库2 -->
        <mirror>
            <id>repo2</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo2.maven.org/maven2/</url>
        </mirror>
  </mirrors>

猜你喜欢

转载自blog.csdn.net/toto1297488504/article/details/82351459