基于eclipse创建maven报错Failure to transfer org.codehaus.plexus:plexus-archiver:jar:2.0.1 from http://repo

 因为工作需要,换了一台电脑 然后报一下错误
Failure to transfer org.codehaus.plexus:plexus-archiver:jar:2.0.1 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:jar:2.0.1 from/to central (http://repo.maven.apache.org/maven2): 
 No response received after 60000
  以下是尝试的方法
1.先去掉Maven工程的maven特性,选中工程 鼠标右键-->Maven-->Disable Maven Nature. 此步骤后pom.xml错误消失
2.为工程增加Maven特性,选中工程 鼠标右键-->Configure-->Convert to Maven Project.
经过上述步骤,Maven工程就正常了。

网络不好的情况下,最好建立本地私服。

中央仓库对应jar的地址如下:

http://mvnrepository.com/artifact/org.codehaus.plexus/plexus-archiver

刷新项目终于好了,首先我们得保证maven_jdk和工作站中选择的jre是同一个版本,不然会出现运行错误,然后试着运行test命令,发下出现如下异常:

-Dmaven.multiModuleProjectDirectory system property is not set. Check $M2_HOME environment variable and mvn script match.

解决方式如下,加入:-Dmaven.multiModuleProjectDirectory=$M2_HOME

eclipse:



猜你喜欢

转载自blog.csdn.net/m0_37942145/article/details/79410206