侧边栏壁纸
博主头像
YOUZI

我依旧在追寻自由的路上

  • 累计撰写 85 篇文章
  • 累计创建 10 个分类
  • 累计创建 27 个标签

目 录CONTENT

文章目录

阿里云maven

柚子
原创 / 2024-07-09 / 0 评论 / 0 点赞 / 20 阅读 / 0 字
温馨提示:
本文最后更新于72天前,若内容或图片失效,请留言反馈。 部分素材来自网络,若不小心影响您的利益,请联系 站长 删除。

背景

今天创建了一个spring boot的demo项目,发现maven一直拉取失败,用了两年一直没有问题,报了如下错误。

Non-resolvable parent POM for com.elysia:demo:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.springframework.boot:spring-boot-starter-parent:pom:3.2.7 (absent): org.springframework.boot:spring-boot-starter-parent:pom:3.2.7 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:3.2.7 from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public/): Connect to archiva-maven-storage-prod.oss-cn-beijing.aliyuncs.com:443 [archiva-maven-storage-prod.oss-cn-beijing.aliyuncs.com/211.154.222.157] failed: Connect timed out and 'parent.relativePath' points at no local POM

看不懂,但根据经验从failed to transfer from http://maven.aliyun.com/nexus/content/groups/public/这里大致能看出是这个链接的问题。于是我去看了maven的配置。

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

解决

阿里maven官网看了配置指南,发现改成了下面这样。

<mirror>
  <id>aliyunmaven</id>
  <mirrorOf>*</mirrorOf>
  <name>阿里云公共仓库</name>
  <url>https://maven.aliyun.com/repository/public</url>
</mirror>

换源后顺利拉取。

0

评论区