eclipse创建maven项目,报错
2019-08-05 本文已影响0人
bianruifeng
报错如下:
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 nexus-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 nexus-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 nexus-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 nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public/): maven.aliyun.com
截图如下:

一、重新下载maven-archetype-webapp-1.0.jar
方法为:进入maven本地仓库org\apache\maven\archetypes\maven-archetype-webapp\1.0目录下删除.lastUpdate文件,当再次创建web时项目时,ide会自动下载相关的jar包。
二、配置Catalog
在eclipse中,点击window-->preferences-->maven-->archetype,在archetype页面中点击 “Add Remote Catalog”,在弹出框的catalog File输入框中填写“http://repo1.maven.org/maven2/archetype-catalog.xml”(引号不要),下面description根据自己喜好填写。然后再次创建maven项目时选择自己刚才新建的catalog,然后再选择 org.apache.maven.archetypes maven-archetype-webapp;
我尝试重新下载解决了问题。
转载:csdn