eclipse maven工程时报错Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart

时间:2021-05-20 23:14:49

在新建maven工程时报错:

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.
  Could not resolve artifact
    Missing org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE

解决思路:在本地库中装载maven-archetype-quickstart

1.从 http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/  这个我下不了 从csdn下载的,有免费的
下载最新版maven-archetype-quickstart-1.1.jar

2.cmd窗口执行mvn install:install-file -DgroupId=org.apache.maven.archetypes -DartifactId=maven-archetype-quickstart -Dversion=1.1 -Dpackaging=jar -Dfile=maven-archetype-quickstart-1.1.jar

执行这个一直报连接fail,后来想到我把maven代理源换成OSCHINA的了,改成本来的

  <mirror>
        <id>repo2</id>
        <mirrorOf>central</mirrorOf>
        <name>Human Readable Name for this Mirror.</name>
        <url>http://repo2.maven.org/maven2/</url>
    </mirror>

    <mirror>
        <id>ui</id>
        <mirrorOf>central</mirrorOf>
        <name>Human Readable Name for this Mirror.</name>
        <url>http://uk.maven.org/maven2/</url>
    </mirror>

    <mirror>
        <id>jboss-public-repository-group</id>
        <mirrorOf>central</mirrorOf>
        <name>JBoss Public Repository Group</name>
        <url>http://repository.jboss.org/nexus/content/groups/public</url>
    </mirror>


再创建maven工程,成功