解决 IDEA 下载源码失败的问题maven-default-http-blocker (http://0.0.0.0/) Blocked mirror for repositories


title: 解决 IDEA 下载源码失败的问题maven-default-http-blocker (http://0.0.0.0/) Blocked mirror for repositories
date: 2022-01-25 00:00:00
tags:

  • 问题
  • IDE使用
    categories:
  • Maven

今天发现在 IDEA 中下载源码失败,通过查看 IDEA 日志看到了出错的原因:

tail -f ~/Library/Logs/JetBrains/IntelliJIdea2021.3/idea.log

再次单击下载源码按钮后实时输出:

2022-01-25 17:23:15,247 [ 135367]   INFO -      #org.jetbrains.idea.maven - org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.springframework:spring-webmvc:jar:sources:5.3.15 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public, default, releases)]
	in DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:424)
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.springframework:spring-webmvc:jar:sources:5.3.15 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public, default, releases)]
	in DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
	... 24 more
Caused by: org.eclipse.aether.transfer.NoRepositoryConnectorException: Blocked mirror for repositories: [nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public, default, releases)]
	in DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:506)
	... 25 more

查到是 maven 3.8.1 版本带来的限制,详见版本说明

最后解决这个问题也比较简单,使用https协议的仓库地址即可:vim ~/.m2/settings.xml

170         <mirror>
171                 <id>nexus-aliyun</id>
172                 <mirrorOf>central</mirrorOf>
173                 <name>Nexus aliyun</name>
174                 <url>https://maven.aliyun.com/nexus/content/groups/public</url>
175         </mirror>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值