eclipse报: Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp: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

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值