eclipse报: Could not resolve archetype org.apache.maven.archetypes:mavenarchetypewebapp:1.0 错误

–>

一、错误描述:

eclipse新建maven-archetype-webapp项目时报错:

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured repositories

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0
Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven-aliyun has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to maven-aliyun (http://maven.aliyun.com/nexus/content/groups/public/): maven.aliyun.com
Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven-aliyun has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to maven-aliyun (http://maven.aliyun.com/nexus/content/groups/public/): maven.aliyun.com

出现这种问题的主要原因就是在仓库中找不到maven-archetype-webapp-1.0.jar,我配置的是阿里巴巴的仓库。

二、解决方法:

两种解决方式

第一种方法:

1、在Eclipse Maven配置中添加新的Catalog配置:

http://repo1.maven.org/maven2/archetype-catalog.xml

 

点击OK,然后点击Apply。

接下来在使用刚添加的catalog创建web工程

点击Finish还是报错

第一种方法不行

第二种方法:

1、从http://maven.ibiblio.org/maven2/org/apache/maven/archetypes/ 下载最新版maven-archetype-webapp-1.0.jar

2、命令行到下载目录下执行mvn install:install-file -DgroupId=org.apache.maven.archetypes -DartifactId=maven-archetype-webapp -Dversion=1.0 -Dpackaging=jar -Dfile=maven-archetype-webapp-1.0.jar
报错

以上报错的原因是:在settings.xml 文件中 mirrors出了问题。

然后在setting.xml配置文件上面我添加了一个新的mirror,添加后如下:

进入那个目录,然后在控制台下我重新输入:

mvn install:install-file -DgroupId=org.apache.maven.archetypes -DartifactId=maven-archetype-webapp -Dversion=1.0 -Dpackaging=jar -Dfile=maven-archetype-webapp-1.0.jar
回车,就可以看到重新下载了好多的jar包文件。

然后从新新建maven-webapp项目

 

 

 

还是报错。。。。

 

然后选择这个类型的

 

发现已经在下载了

然后又报这种错

 

 

最后没办法,想到有可能是阿里云的那个仓库的原因,然后把它屏蔽掉!!

 

 

然后再新建maven webapp项目就可以了。。。。

 

————————————————————————

本文转自(https://blog.csdn.net/u011781521/article/details/53691593)

 

 

本文来源 互联网收集,文章内容系作者个人观点,不代表 本站 对观点赞同或支持。如需转载,请注明文章来源,如您发现有涉嫌抄袭侵权的内容,请联系本站核实处理。

© 版权声明

相关文章