eclipse 创建maven的webapp骨架失败解决方法

第一次在eclipse上使用maven,按照教程做,点击finish后出现两个弹窗,详细信息如下。

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 https://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.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from https://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.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org

  其实我感觉就是eclipse的默认maven插件没有需要的catalog,解析不到导致的。而eclipse联网很差,所以最好下载下来放在本地,位置没有要求。

下载地址:http://repo1.maven.org/maven2/archetype-catalog.xml

eclipse 创建maven的webapp骨架失败解决方法_第1张图片
下载catalog

如果还不行,那可能是你之前选择远程添加catalog,你找到你的仓库下的webapp删掉,下次创建项目eclipse才能自动搜索。需要删除的位置在:

%你的默认本地仓库%\repository\org\apache\maven\archetypes\maven-archetype-webapp\1.0


eclipse 创建maven的webapp骨架失败解决方法_第2张图片
maven插件添加catalog

然后创建maven项目如下图:


eclipse 创建maven的webapp骨架失败解决方法_第3张图片
创建maven

finish后可以看到下面的更新,webapp项目创建成功。
注:eclipse默认插件可以在window下preferences找到maven。

你可能感兴趣的:(eclipse 创建maven的webapp骨架失败解决方法)