我正在尝试在linux centos上构建一个java web services app maven项目但是出现以下错误:
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/23.235.44.215] failed: Connection timed out.
我可以将网址解析为ip:
nslookup repo.maven.apache.org
Server: 69.252.80.80
Address: 69.252.80.80#53
Non-authoritative answer:
repo.maven.apache.org canonical name = repo.apache.maven.org.
repo.apache.maven.org canonical name = maven.map.fastly.net.
Name: maven.map.fastly.net
Address: 23.235.40.215
ping服务器确定
-sh-4.1$ ping 69.252.80.80
PING 69.252.80.80 (69.252.80.80) 56(84) bytes of data.
64 bytes from 69.252.80.80: icmp_seq=1 ttl=60 time=1.07 ms
64 bytes from 69.252.80.80: icmp_seq=2 ttl=60 time=1.13 ms
但如果直接ping网址,则无响应
ping repo.maven.apache.org
PING maven.map.fastly.net (23.235.47.215) 56(84) bytes of data
我尝试添加
<repositories>
<repository>
<id>central</id>
<name>Central</name>
<url>http://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>plugins</id>
<name>Plugins</name>
<url>http://repo.maven.apache.org/maven2/org/apache/maven/plugins/</url>
</repository>
</repositories>
到pom.xml。结果相同。
有什么想法吗?
谢谢你, 格雷格