在公司用的電信的,下載正常,到家裏面就更新不了了。運行mvn help:system都一直warning:Failed to retrieve plugin descriptor for .....
後來查資料,發現確實跟運營商的網絡有關。
在maven目錄下的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>
-->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/repository/central</url>
</mirror>
</mirrors>
Maven是當前流行的項目管理工具,但官方的庫在國外經常連不上,連上也下載速度很慢。國內oschina的maven服務器很早之前就關了。今天發現阿里雲的一箇中央倉庫,親測可用。
1 <mirror>
2 <id>alimaven</id>
3 <mirrorOf>central</mirrorOf>
4 <name>aliyun maven</name>
5 <url>https://maven.aliyun.com/repository/central</url>
6 </mirror>