zoukankan      html  css  js  c++  java
  • maven命令创建应用报错问题解决

    C:\Users\tx>mvn archetype:generate -DgroupId=com.alibaba.webx -DartifactId=tutorial3 -Dversion=1.0-SNAPSHOT -Dp
    ackage=com.alibaba.webx.tutorial3 -DarchetypeArtifactId=archetype-simple-webx3 -DarchetypeGroupId=com.alibaba.citrus.sam
    ple -DinteractiveMode=false
    [INFO] Scanning for projects...
    [INFO] Searching repository for plugin with prefix: 'archetype'.
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Error building POM (may not be this project's POM).
    
    
    Project ID: org.apache.maven.plugins:maven-archetype-plugin
    
    Reason: Error getting POM for 'org.apache.maven.plugins:maven-archetype-plugin' from the repository: Failed to resolve a
    rtifact, possibly due to a repository list that is not appropriately equipped for this artifact's metadata.
      org.apache.maven.plugins:maven-archetype-plugin:pom:2.3-SNAPSHOT
    
    from the specified remote repositories:
      central (http://repo1.maven.org/maven2)
    
     for project org.apache.maven.plugins:maven-archetype-plugin
    
    
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: < 1 second
    [INFO] Finished at: Fri Nov 09 11:28:07 CST 2012
    [INFO] Final Memory: 2M/1016M
    [INFO] ------------------------------------------------------------------------

    mvn archtype:generate 自行会到本地仓库查找archtype插件,查看本地D:\work\repository\org\apache\maven\plugins\maven-archetype-plugin下的插件版本为2.2,而maven-metadata-central.xml是2.3-SNAPSHOT并且仓库中没有这个版本的jar包,所以出错。

    <?xml version="1.0" encoding="UTF-8"?>
    <metadata>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-archetype-plugin</artifactId>
      <versioning>
        <latest>2.3-SNAPSHOT</latest>
        <release>2.2</release>
        <versions>
          <version>1.0-alpha-3</version>
          <version>1.0-alpha-4</version>
          <version>1.0-alpha-7</version>
          <version>2.0-alpha-1</version>
          <version>2.0-alpha-2</version>
          <version>2.0-alpha-3</version>
          <version>2.0-alpha-4</version>
          <version>2.0-alpha-4-alipay</version>
          <version>2.0-alpha-4.alipay</version>
          <version>2.0-alpha-4-alipay-bugfix1</version>
          <version>2.0-alpha-4-alipay-bugfix2</version>
          <version>2.0-alpha-5</version>
          <version>2.0-alpha-6-SNAPSHOT</version>
          <version>2.0</version>
          <version>2.1</version>
          <version>2.2</version>
          <version>2.3-SNAPSHOT</version>
        </versions>
        <lastUpdated>20120228230945</lastUpdated>
      </versioning>
    </metadata>

    解决方法:

       把maven-metadata-central.xml文件中的2.3-SNAPSHOT去掉,选择2.2版本。

       

  • 相关阅读:
    【Vijos1159】岳麓山上打水 [迭代加深]
    【POJ3134】 Power Calculus [迭代加深]
    【2019.1.24】 搜索,动规 经典题目体验赛
    【noip2017】
    【poj3311】Hie With The Pie [状压dp]
    [bzoj3938] [Uoj #88] Robot
    [洛谷P4707] 重返现世
    [洛谷P4097] [HEOI2013] Segment
    KD-tree 学习小记
    NOI2019 酱油记
  • 原文地址:https://www.cnblogs.com/iusmile/p/2762307.html
Copyright © 2011-2022 走看看