maven镜像加速

因为maven默认是在http://my.repository.com/repo/path下载镜像包,外网一般下载比较慢,所以我们需要使用国内镜像地址进行加快下载速度

在maven安装路径,以我的地址路径为示例:C:\Program Files\Java\apache-maven-3.6.3-bin\apache-maven-3.6.3

在该文件夹的conf文件夹路径下有个settings.xml文件

修改原有的镜像

  <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>
     -->
  </mirrors>

  <mirrors>
    
    <!--阿里云镜像-->
    <mirror>
        <id>nexus-aliyun</id>
        <mirrorOf>*</mirrorOf>
        <name>Nexus aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>
    
    
    
  </mirrors>

 

posted @ 2020-12-20 13:29  小段-长沙  阅读(1354)  评论(0编辑  收藏  举报
可以转载,转载需注明出处