无法访问 Maven 3.8.1 http 仓库

报错内容:

org.springframework.boot:spring-boot-starter-parent:pom:1.5.7.RELEASE failed to transfer from http://maven.aliyun.com/nexus/content/groups/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of alimaven has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.7.RELEASE from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public/): Blocked mirror for repositories: [central (https://repo.maven.apache.org/maven2, default, releases)]

无法访问 Maven 3.8.1 http 仓库。

可能的解决方案:
- 检查 Maven settings.xml 是否不包含 http 仓库
- 检查 Maven pom 文件是否不包含 http 仓库 http://maven.aliyun.com/nexus/content/groups/public/
- 检查 Maven pom 文件是否不包含 http 仓库 http://maven.aliyun.com/nexus/content/groups/public/
- 检查 Maven pom 文件是否不包含 http 仓库 https://repo.maven.apache.org/maven2
- 在 Maven settings.xml 中为 http://maven.aliyun.com/nexus/content/groups/public/, http://maven.aliyun.com/nexus/content/groups/public/, https://repo.maven.apache.org/maven2 添加允许 http url 的镜像
- 在设置中将 Maven 降级到 3.8.1 或更早的版本

 

解决:

参考路径:https://blog.csdn.net/m0_56088675/article/details/145594636

这个问题可能与 Maven 3.8.1 不允许使用非安全的 http 仓库有关。以下是解决方法的详细步骤:

1、修改Maven settings.xml

原值:

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

修改为:

<mirror>
<id>alimaven</id>
<mirrorOf>*</mirrorOf>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>

然后运行命令:mvn clean install -U

但是又报错有个gexip的包下载不下来

Maven settings.xml又还原为

原值:

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

然后刷新maven 就全部下载下来了

运行项目

posted on 2025-08-06 09:56  yr1126  阅读(388)  评论(0)    收藏  举报