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

Can't add spring boot devtools dependency in pom.xml file

解决问题后启动应用程序时出现。

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 可以访问。

您的本地版本(在 ~/.m2/repository 内)似乎已损坏此依赖项。尝试在那里删除它并再次从 Maven Central 重新启动下载过程。

当您在添加依赖项后构建应用程序时,当 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 开关。

所以 运行 你的 maven 目标 -U switch 就像 mvn <goal> -U