repo.maven.apache.org timeout解決辦法

hadoop-2.7.1編譯native lib過程當中,運行mvn package -Pdist,native -Dskiptests -Dtar 的時候遭遇各類maven-plugin失敗,提示:html

repo.maven.apache.org timeout,緣由是國內鏈接這個URL失敗,翻過長城能夠順利鏈接。apache

解決辦法:eclipse

修改 /path-to-maven/conf/setting.xml,參照:http://maven.apache.org/guides/mini/guide-mirror-settings.html,添加mirror:maven

   <mirror>ide

     <id>UK</id>oop

     <name>UK Central</name>ui

     <url>http://uk.maven.org/maven2</url>url

     <mirrorOf>central</mirrorOf>xml

   </mirror>htm

終於看到下載畫面了:

若是是在公司內執行,別忘了在setting.xml中設定proxy認證信息。

該方法一樣適用於eclipse中的maven設定:.m2/setting.xml

相關文章
相關標籤/搜索