maven更新失败

maven更新包失败,大概报如下错误,当时未记录错误日志

1
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 of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-archiver:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Connect timed out

强制更新无效,后采用如下方式问题得以解决:

1
2
cd %userprofile%.m2repository
for /r %i in (*.lastUpdated) do del %i

解决方案来自:http://stackoverflow.com/questions/5074063/maven-error-failure-to-transfer