Maven报错:Failure to transfer org.apache.maven
在创建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并未下载到本地
解决问题的办法很简单:
步骤一:你可以到本地库中搜索“.lastUpdated”结尾的文件并且删除
1.进入dos窗口
2.进入本地仓库文件夹下执行命令: del *.lastUpdated /s /f /q