故障排查:maven下载依赖失败(Transfer failed)

2年前 (2022) 程序员胖胖胖虎阿
305 0 0

博客主页:https://tomcat.blog.csdn.net
博主昵称:农民工老王
主要领域:Java、Linux、K8S
期待大家的关注💖点赞👍收藏⭐留言💬
故障排查:maven下载依赖失败(Transfer failed)

目录

  • 故障详情
  • 发现原因
  • 解决故障

故障详情

最近在一台Window Server 2016虚拟机上安装IDEA,并在其中运行一个maven项目。没想到maven不能拉取依赖,一直报如下的错误。

Failure to transfer org.apache.commons:commons-lang3:pom:3.11 from https://maven.aliyun.com/repository/central was cached in the local repository, resolution will not be reattempted until the update interval of aliyun-public has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.commons:commons-lang3:pom:3.11 from/to aliyun-public (https://maven.aliyun.com/repository/central): Transfer failed for https://maven.aliyun.com/repository/central/org/apache/commons/commons-lang3/3.11/commons-lang3-3.11.pom

Try run Maven import with -U flag (force update snapshots)

故障排查:maven下载依赖失败(Transfer failed)我排查了IDEA和maven的配置信息,都没有发现异常,而且maven的settings.xml文件是我从现有的电脑上复制上去的。我也请邻座的Java大佬帮我看了下,他也觉得一切设置都是正常。我和他都都这个报错感到莫名其妙。

发现原因

过了一天我才发现原因:虚拟机的时间设置异常,导致了上述报错。
故障排查:maven下载依赖失败(Transfer failed)

解决故障

真是活久见,没想到时间问题也能导致maven异常。
找到了报错原因,那解决这个故障也就很容易了。按照以下步骤的操作可以消除maven的报错,并实现依赖的顺利下载:

1.修正时间设置,开启自动设置时间,自动设置时区。
故障排查:maven下载依赖失败(Transfer failed)
2.删除本地仓库目录下的临时文件。
故障排查:maven下载依赖失败(Transfer failed)3.点击IDEA中的重新加载maven项目的按钮。
故障排查:maven下载依赖失败(Transfer failed)


如需转载,请注明本文的出处:农民工老王的CSDN博客https://blog.csdn.net/monarch91 。

版权声明:程序员胖胖胖虎阿 发表于 2022年10月11日 下午2:00。
转载请注明:故障排查:maven下载依赖失败(Transfer failed) | 胖虎的工具箱-编程导航

相关文章

暂无评论

暂无评论...