博客主页:https://tomcat.blog.csdn.net 博主昵称:农民工老王 主要领域:Java、Linux、K8S 期待大家的关注💖点赞👍收藏?留言💬 
故障详情
最近在一台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)
我排查了IDEA和maven的配置信息,都没有发现异常,而且maven的settings.xml文件是我从现有的电脑上复制上去的。我也请邻座的Java大佬帮我看了下,他也觉得一切设置都是正常。我和他都都这个报错感到莫名其妙。
发现原因
过了一天我才发现原因:虚拟机的时间设置异常,导致了上述报错。 
解决故障
真是活久见,没想到时间问题也能导致maven异常。 找到了报错原因,那解决这个故障也就很容易了。按照以下步骤的操作可以消除maven的报错,并实现依赖的顺利下载:
1.修正时间设置,开启自动设置时间,自动设置时区。  2.删除本地仓库目录下的临时文件。 3.点击IDEA中的重新加载maven项目的按钮。 
如需转载,请注明本文的出处:农民工老王的CSDN博客https://blog.csdn.net/monarch91 。
|