maven创建项目后报错“plexus-archiver:pom:1.0”

搭建maven项目时出现Failure to transfer org.codehaus.plexus:异常

今天换了台电脑在创建maven项目的时候发现pom.xml中提示如下错误

 

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极速上手视频,手把手教你从pom到私服,点这里

 

仔细查看了仓库中少了提示中的包,去maven的中央仓库将该包下载下来放到本地仓库中,如下:

maven创建项目后报错“plexus-archiver:pom:1.0”_第1张图片

 

 刷新pom.xml后又出现如下错误,然候我依葫芦画瓢又去仓库下载了提示中的包放入对应的版本文件夹

 

 Failure to transfer org.codehaus.plexus:plexus-archiver:jar:1.2 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:1.2 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000
 
 Failure to transfer org.codehaus.plexus:plexus-io:jar:1.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-io:jar:
 1.0.1 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000

 

 

中央仓库对应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:

maven创建项目后报错“plexus-archiver:pom:1.0”_第2张图片

 

IDEA:若不加入执行时会一直打转,找不到相应的artchetype01

maven创建项目后报错“plexus-archiver:pom:1.0”_第3张图片

去网上看了下异常-Dmaven.multiModuleProjectDirectory,说是mave项目3版本的bug,国外的朋友已经提了issue,我也是接触maven不久,知道该问题的大神烦请告知

 

你可能感兴趣的:(问题汇总,Java)