12

解决 IDEA 下载源码失败的问题 maven-default-http-blocker (http://0.0.0.0/) Blocke...

 3 years ago
source link: https://tianmingxing.com/2022/01/25/%E8%A7%A3%E5%86%B3%20IDEA%20%E4%B8%8B%E8%BD%BD%E6%BA%90%E7%A0%81%E5%A4%B1%E8%B4%A5%E7%9A%84%E9%97%AE%E9%A2%98/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

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

发表于

2022-01-25 分类于 Maven

阅读次数: 3 Disqus: 0 Comments

今天发现在 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>

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK