参考网址:http://www.mkyong.com/maven/how-to-convert-maven-java-project-to-support-eclipse-ide/

     https://blog.csdn.net/gsycwh/article/details/52792633

问题描述:

在创建Maven项目时,经常会在pom.xml的第一行处报错,提示信息如下:

Failure to transfer org.apache.maven:maven-surefire-plugin:jar:2.5 from http:// 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:maven- archiver:jar:2.5 from/to central (http://repo.maven.apache.org/maven2): The operation was cancelled.

问题分析:

  maven的plugin并未下载到本地

解决办法1(优先):

  1.Navigate to your Java project folder, where pom.xml file is placed.

    mvn eclipse:eclipse

     【 如果有错误,会显示错误的原因。】

  2.根据错误原因,你可以到本地库中搜索“.lastUpdated”结尾的文件,找到一份 maven-surefire-plugin-2.7.1.pom.lastUpdated的文件,将其删除。如未自行设置,本地仓库为C:\Users\admin\.m2\repository。

  3. mvn eclipse:eclipse

    【成功】

解决办法2:

  1. 你可以到本地库中搜索“.lastUpdated”结尾的文件,找到一份 maven-surefire-plugin-2.7.1.pom.lastUpdated的文件,将其删除。如未自行设置,本地仓库为C:\Users\admin\.m2\repository。

  2.回到项目中,在项目右键点击project -> Maven -> Update Dependencies(Update Project…)更新项目,这时候应该就没有错了。

注意:

  1.maven-surefire-plugin-2.7.1.pom.lastUpdated文件不是固定的,而是要看报错的具体信息,如上面错误信息中,主要看报错的maven:后面紧跟的信息

  2.方法一和方法二的区别在于 错误的原因更详细、具体、准确。

 

maven坑-Failure to transfer org.apache.maven:maven的更多相关文章

  1. Maven 问题 Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:3.0.0-M1 的处理

    一.问题描述 Maven项目报错,该项目是导入的项目,然后再通过开发工具打开项目时,pom.xml文件报错. 并且新建Maven Project 也会报错. 二.报错详细Failure to tran ...

  2. Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval o

    pom.xml报错: Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from https://repo.maven.apach ...

  3. Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from http://repo.maven.apache.org/ maven2 was cached in the local repository, resolution will not be reattempted until the update interv

    Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from http://repo.maven.apache.org/  mave ...

  4. Maven问题:Failure to transfer org.apache.maven

    Maven报错:Failure to transfer org.apache.maven 在创建Maven项目时,经常会在pom.xml的第一行处报错,提示信息如下: Failure to trans ...

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

    详细报错如下 Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.17 from http://maven ...

  6. Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4

    Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from https://repo.mave ...

  7. WebMagic编译时提示Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.18的解决方法

    问题描述:    从http://git.oschina.net/flashsword20/webmagic 下载最新代码,按照http://webmagic.io/docs/zh/posts/ch3 ...

  8. maven 新建项目时报错“Could not calculate build plan: Failure to transfer org.apache.maven.plugins:。。。。。。。。。。。。。。”

    首先,我们看到观察这个错误:Failure to transfer org.apache.maven.plugins,这种错误是项目部署时,maven所关联的仓库中插件的设置出错了. 所以我们需要找到 ...

  9. 解决:Failure to transfer org.apache.maven.plugins:maven-jar-plugin:pom:2.4 from错误

    在使用Maven时出现以下错误: Failure to transfer org.apache.maven.plugins:maven-jar-plugin:pom:2.4 from https:// ...

随机推荐

  1. Github提交本地代码

     第一步:建立git仓库 cd到你的本地项目根目录下,执行git命令 git init 第二步:将项目的所有文件添加到仓库中 git add . 如果想添加某个特定的文件,只需把.换成特定的文件名即可 ...

  2. 学习Android过程中遇到的未解决问题(个人笔记,细节补充,随时更新)

    201811/13 使用HttpURLConnection对象调用方法又出现IO异常,我又百度个博客搜寻答案,未果.下午试试真机,完美.自己建了服务器tomcat,编写android访问自己tomca ...

  3. Matplotlib学习---用matplotlib画阶梯图(step plot)

    这里利用Nathan Yau所著的<鲜活的数据:数据可视化指南>一书中的数据,学习画图. 数据地址:http://datasets.flowingdata.com/us-postage.c ...

  4. Get Luffy Out * HDU - 1816(2 - sat 妈的 智障)

    题意: 英语限制了我的行动力....就是两个钥匙不能同时用,两个锁至少开一个 建个图 二分就好了...emm....dfs  开头low 写成sccno  然后生活失去希望... #include & ...

  5. AtCoder Regular Contest 102 E Stop. Otherwise...

    题目链接:atcoder 大意:有\(n\)个骰子,每个骰子上面有\(k\)个数,分别是\(1\text ~ k\),现在求\(\forall i\in[2...2k]\),求出有多少种骰子点数的组合 ...

  6. Linux mount BSD disk partition

    Linux mount BSD disk partition 来源 https://www.cnblogs.com/jhcelue/p/6858159.html 假设须要从第二块硬盘复制文件.该硬盘格 ...

  7. Hdoj 2289.Cup 题解

    Problem Description The WHU ACM Team has a big cup, with which every member drinks water. Now, we kn ...

  8. poj 3279 Fliptile(二进制搜索)

    Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He ha ...

  9. Electron入门笔记(一)-自己快速搭建一个app demo

    Electron学习-快速搭建app demo 作者: 狐狸家的鱼 Github: 八至 一.安装Node 1.从node官网下载 ,最好安装.msi后缀名的文件,新手可以查看安装教程进行安装. 2. ...

  10. c语言: 修改参数的地址,及注意事项

    如果需要在函数中修改参数的地址,首先参数肯定要是指针类型,同时传递的参数不能直接使用数组变量,至少需要先转换一下. 比如: char str[] = "123"; 不能直接传 ab ...