Create a project using maven error Could not resolve archetype org.apache.maven.archetype

error:

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



Solutions: loading maven-archetype-quickstart-1.1.jar local library in
step 1 from http://maven.ibiblio.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/maven-. archetype-quickstart-1.1.jar

Download the latest version of the maven-archetype-quickstart-1.1.jar

 

Step 2 .cmd window into the jar under the package directory maven installation directory and above was put into the lib lib directory, then execution

mvn install:install-file -DgroupId=org.apache.maven.archetypes -DartifactId=maven-archetype-quickstart -Dversion=1.1 -Dpackaging=jar -Dfile=maven-archetype-webapp-1.0.jar

Additional description:

According to the above steps still does not work, find out why. maven configuration of the image library is oschina, seemingly closed. Then switch to Ali on it. Enter maven installation directory under the conf directory of setting.xml modify the image file attached comparison of the whole image library MAVEN dependent address:

<!--指定阿里云仓库-->
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
    <mirror>
        <id>central</id>
        <name>Maven Repository Switchboard</name>
        <url>http://repo1.maven.org/maven2/</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
    <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>ibiblio</id>
        <mirrorOf>central</mirrorOf>
        <name>Human Readable Name for this Mirror.</name>
        <url>http://mirrors.ibiblio.org/pub/mirrors/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>
    <!-- 中央仓库在中国的镜像 -->
    <mirror>
        <id>maven.net.cn</id>
        <name>oneof the central mirrors in china</name>
        <url>http://maven.net.cn/content/groups/public/</url>
        <mirrorOf>central</mirrorOf>
    </mirror>

 

Guess you like

Origin www.cnblogs.com/jiafeimao-dabai/p/11725107.html