解决Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4问题

有时候我们的maven工程的pom.xml文件第一行会报如下错误:

Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from https://repo.maven.apache.org/maven2 was cached in the local repository,resolution will not be reattempted until the update interval of central has elapsed or updates are forced.Original error: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to central (https://repo.maven.apache.org/maven2):

The  operation was cancelled.

可以尝试以下方法解决:

1.找到maven库目录,进入:\org\apache\maven\plugins\maven-surefire-plugin\2.12.4

2.若2.12.4目录下有maven-surefire-plugin-2.12.4.pom.lastUpdated文件,将其删除

3.项目右键–>maven–>Update Dependencies

    原文作者:李北北
    原文地址: https://www.jianshu.com/p/c27eacf92209
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞