解决 Maven Connection timed out 问题

本文介绍了当使用Maven连接官方中央库时遇到连接超时问题的解决方法。通过配置代理或更换镜像站点的方式可以有效解决该问题,文中提供了一个可用的英国镜像站点配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在国内连接 Maven 官方的中央库会出现Connection timed out问题。 出错提示

[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]

解决办法有:

  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>

转载于:https://my.oschina.net/u/553266/blog/789421

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值