解決 Maven Connection timed out 問題

在國內鏈接 Maven 官方的中央庫會出現Connection timed out問題。 出錯提示spring

[ERROR] Failed to execute goal on project gs-maven: Could not resolve dependencies for project org.springframework:gs-maven:jar:0.1.0: Failed to collect dependencies at joda-time:joda-time:jar:2.2: Failed to read artifact descriptor for joda-time:joda-time:jar:2.2: Could not transfer artifact joda-time:joda-time:pom:2.2 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.16.215] failed: Connection timed out: connect -> [Help 1]

解決辦法有:apache

  1. 設置代理 能夠在.m2/settings.xml中設置proxy.前提是你得有穩定好使的代理.
  2. 本身架設或找個鏡像站以便連上去 本身架設。。。因爲想盡快搞定,不去花這心思了。 在Maven官方鏡像介紹的文檔裏找到個UK的鏡像。。。試了下,能用。OK,就是它了。
<mirror>
		<id>UK</id>
		<name>UK Central</name>
		<url>http://uk.maven.org/maven2</url>
		<mirrorOf>central</mirrorOf>
	</mirror>
相關文章
相關標籤/搜索