maven下载依赖log4j的1.2.16失败

报错信息如下:

log4j:log4j:pom:1.2.16 failed to transfer from https://maven.aliyun.com/repository/central during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of alimaven has elapsed or updates are forced. Original error: Could not transfer artifact log4j:log4j:pom:1.2.16 from/to alimaven (https://maven.aliyun.com/repository/central): transfer failed for https://maven.aliyun.com/repository/central/log4j/log4j/1.2.16/log4j-1.2.16.pom

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

解决步骤:

1.换网

从家里wifi切换到手机热点,有时候网不好,会出问题 (之前没有wifi,一直是用手机热点连着电脑的,下载依赖没有任何问题,今天在家用wifi下载就报错了)

2.换完网后,下载1.2.17可以,但是1.2.16不行,需要删除原来下载失败的1.2.16的文件夹

原因:报错信息中提到

This failure was cached in the local repository and resolution is not reattempted until the update interval of alimaven has elapsed or updates are forced.

之前的尝试中。此故障已缓存在本地存储库中,在alimavin的更新间隔结束或强制更新之前,不会再次尝试解决

是因为之前尝试下载这个依赖,失败了,但是会在local repository 生成一个文件夹,再次下载,就会先去找这个文件夹,需要手动把这个文件夹删除。

3.再次下载,就可以了

推荐阅读

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: