首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在pom.xml文件中添加spring启动devtools依赖项

无法在pom.xml文件中添加spring启动devtools依赖项
EN

Stack Overflow用户
提问于 2022-03-30 09:35:46
回答 2查看 833关注 0票数 -1

启动应用程序时,将引发解决问题。

代码语言:javascript
复制
Cannot resolve org.springframework.boot:spring-boot-devtools:pom:2.6.5 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt.
This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced.
Original error: Could not transfer artifact org.springframework.boot:spring-boot-devtools:pom:2.6.5 from/to central (https://repo.maven.apache.org/maven2):
    transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-devtools/2.6.5/spring-boot-devtools-2.6.5.pom

该URL是可访问的。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-03-30 09:55:19

该依赖项的本地版本(在~/.m2/repository中)似乎已损坏。尝试在那里删除它,然后再次从maven central重新启动下载过程。

票数 2
EN

Stack Overflow用户

发布于 2022-03-30 10:07:19

当您在添加依赖项之后构建应用程序时,当maven试图下载工件及其依赖项时,下载可能会因为某种原因(可能是网络问题)而失败,然后maven会放置一个带有第一次尝试时间戳的文件。如果在第一次尝试maven构建之后,尝试maven重新组织第一次尝试失败,并检查时间戳以检查是否已经过了足够的时间,如果没有,它将引发This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced

如果要强制maven更新更新间隔之前失败的依赖项,则可以使用-U开关。

因此,使用-U开关(如mvn <goal> -U )运行maven目标

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71674854

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档