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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM