美文网首页
eclipse 创建maven的webapp骨架失败解决方法

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

作者: Bigglesworth | 来源:发表于2017-12-10 16:51 被阅读0次

    第一次在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

    下载catalog

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

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


    maven插件添加catalog

    然后创建maven项目如下图:


    创建maven

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

    相关文章

      网友评论

          本文标题:eclipse 创建maven的webapp骨架失败解决方法

          本文链接:https://www.haomeiwen.com/subject/umrvixtx.html