新建java Maven项目报错Failure to transfer org.codehaus.plexus:plexus-archiver:pom:1.0

在Myeclipse新建java maven项目报错

Failure to transfer org.codehaus.plexus:plexus-archiver:pom:1.0 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.codehaus.plexus:plexus-
 archiver:pom:1.0 from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://repo.maven.apache.org/maven2/org/codehaus/plexus/
 plexus-archiver/1.0/plexus-archiver-1.0.pom

 

解决如下:

在maven 的配置文件config 文件下setting.xml找到<mirrors>添加如下内容,还有一处是自己修改后的本地仓库也需要添加。

<!-- 阿里云仓库 -->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>

第一处:maven的配置文件

新建java Maven项目报错Failure to transfer org.codehaus.plexus:plexus-archiver:pom:1.0

第二处:自己新建的本地仓库

新建java Maven项目报错Failure to transfer org.codehaus.plexus:plexus-archiver:pom:1.0

效果如下

新建java Maven项目报错Failure to transfer org.codehaus.plexus:plexus-archiver:pom:1.0

重启Myecplise,更新项目Update Project Configuration,问题解决

新建java Maven项目报错Failure to transfer org.codehaus.plexus:plexus-archiver:pom:1.0