GeekNewbie 2014-06-16 10:30 采纳率: 0%
浏览 22359

创建Maven项目 pom.xml文件报错

创建maven项目 pom.xml文件提示错误:
Failure to transfer org.apache.maven.surefire:surefire:pom:2.10 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.surefire:surefire:pom:2.10 from/to central (http://repo.maven.apache.org/maven2): java.net.ConnectException:
connection timed out to http://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.10/surefire-2.10.pom

在网上搜索后给出的解决方法是
打开maven的本地库...\repository\org\apache\maven\plugins\maven-surefire-plugin\2.10会发现:里面少只有一个maven-surefire-plugin-2.10.pom.lastUpdated,而没有maven-surefire-plugin-2.10.jar
解决方法:
1.删除maven-surefire-plugin-2.7.1.pom.lastUpdated文件
2.右键点击project -> Maven - Update Dependencies

但我的本地库有aven-surefire-plugin-2.10.jar以及相关文件 没有maven-surefire-plugin-2.10.pom.lastUpdated文件 怎么还报这样的错误 在网上搜索好长时间 一直没有解决 求大神指点!! 谢谢

  • 写回答

3条回答

  • cawsl 2015-12-07 13:59
    关注

    对于Windows操作系统,执行
    cd %userprofile%.m2\repository

    for /r %i in (*.lastUpdated) do del %i
    然后在项目名右击,选择maven->update project,即可。

    评论

报告相同问题?

悬赏问题

  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建