Maven依賴包下載慢--阿里雲讓你飛


  當用maven下載依賴包的時候,用官方的鏡像庫,那慢的真是要死要死的。后來在網上搜到英國的庫(也是慢的不行),國內的oschina更是直接沒法下載呀。不過還好突然發現阿里雲也有鏡像庫,嘗試了以下,速度真是爽到爆,和官方鏡像庫比,真是一個天上,一個地下。好了,不吐槽了,直接看配置。

  就是更改用戶下的settings.xml文件,在<mirrors> </mirrors>中加上阿里雲的鏡像庫

  

  <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>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf> 
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    </mirror>
    <mirror>
      <!--This is used to direct the public snapshots repo in the 
          profile below over to a different nexus group -->
      <id>nexus-public-snapshots</id>
      <mirrorOf>public-snapshots</mirrorOf> 
      <url>http://maven.aliyun.com/nexus/content/repositories/snapshots/</url>
    </mirror>
  </mirrors>

   看看下邊這速度,杠杠的:

  

  享受飛一般的感覺吧

 


免責聲明!

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



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