maven下載jar包速度慢(解決辦法)

maven是支持鏡像的,我們可以在maven的conf文件加下的setting.xml文件中找到<mirrors></mirrors>標籤

  1. <mirrors>  
  2.     <!-- mirror  
  3.      | Specifies a repository mirror site to use instead of a given repository. The repository that  
  4.      | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used  
  5.      | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.  
  6.      |  
  7.     <mirror>  
  8.       <id>mirrorId</id>  
  9.       <mirrorOf>repositoryId</mirrorOf>  
  10.       <name>Human Readable Name for this Mirror.</name>  
  11.       <url>http://my.repository.com/repo/path</url>  
  12.     </mirror>  
  13.      -->  
  14.       
  15.   </mirrors>  


在這個標籤中加入國內的鏡像即可,在這裏推薦阿里雲的鏡像,下載速度有明顯的加快

  1. <mirror>  
  2.  <id>alimaven</id>  
  3.  <mirrorOf>central</mirrorOf>  
  4.  <name>aliyun maven</name>  
  5.  <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>  
  6. </mirror>  

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章