Maven无法下载远程依赖

报错信息

下载依赖失败
由于下载失败导致后续的错误:
Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.5.1 from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public/): transfer failed for http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-parent/2.5.1/spring-boot-starter-parent-2.5.1.pom

试了网上所有的办法–包括但不限于修改镜像、跳过ssl验证、重装idea、更换maven版本、翻墙、使用流量等等,都无法解决。
后来觉得是网络的问题,睡觉的时候突然想到,可能是跟我以前为了阻止Windows自动更新将网络设为了按流量计费导致Windows阻止maven下载依赖的请求(我猜的),将其修改后确实解决了该问题。困扰了我三天的问题终于解决了~可喜可贺。
取消设为按流量计费的连接

今天又遇到了这个问题,但是最后通过换镜像解决了,换的镜像为:

	<mirror>
		<id>alimaven</id>
		<name>aliyun maven</name>
		<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
		<mirrorOf>central</mirrorOf>
	</mirror>

换镜像又不管用了,尝试强制更新,解决问题。(希望别再出毛病了)
mvn clean install -e -U

猜你喜欢

转载自blog.csdn.net/qq_35692783/article/details/118103809
今日推荐