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

Amei1314發表於2016-11-18

  當用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>

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

  

  享受飛一般的感覺吧

 

相關文章