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


    博客主页: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 。

  • 相关阅读:
    IgH Master环境搭建
    学习c++的第十六天
    力扣每日一题:813. 最大平均值和的分组【0-1背包问题】
    day58 单调栈.p1
    Unsupervised Learning of Monocular Depth Estimation and Visual Odometry 论文阅读
    阿里云国际版云服务器Windows系统数据恢复操作步骤
    PMP每日一练 | 考试不迷路-11.28(包含敏捷+多选)
    谁拥有穿越周期的眼光?
    Lvs、Nginx、HAproxy区别及优缺点
    (Note)中文EI检索期刊目录
  • 原文地址:https://blog.csdn.net/monarch91/article/details/125441109