代码之家  ›  专栏  ›  技术社区  ›  Gaurav Agarwal

尝试使用Maven创建Android应用程序时出现构建失败

  •  0
  • Gaurav Agarwal  · 技术社区  · 13 年前

    我正在尝试使用Maven创建一个Android应用程序,如中所述 this blog

    我在Windows命令提示符下尝试了下面的命令,但得到了“生成失败”,为什么?

    C:\Users\abc\Desktop>mvn archetype:generate -DarchetypeArtifactId=android-qui
    ckstart \ -DarchetypeGroupId=de.akquinet.android.archetypes \ -DarchetypeVersion
    =1.0.8 \ -DgroupId=com.yourcompany \ -DartifactId=yourandroidapp
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 0.143s
    [INFO] Finished at: Wed Sep 12 05:58:36 IST 2012
    [INFO] Final Memory: 2M/56M
    [INFO] ------------------------------------------------------------------------
    [ERROR] The goal you specified requires a project to execute but there is no POM
     in this directory (C:\Users\abc\Desktop). Please verify you invoked Maven fr
    om the correct directory. -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
    ch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please rea
    d the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProject
    Exception
    
    1 回复  |  直到 13 年前
        1
  •  2
  •   yorkw    13 年前

    反斜杠\在Linux shell命令中表示换行符,如果您在Windows上运行,只需删除它们:

    mvn archetype:generate -DarchetypeArtifactId=android-quickstart -DarchetypeGroupId=de.akquinet.android.archetypes -DarchetypeVersion=1.0.8 -DgroupId=com.yourcompany -DartifactId=yourandroidapp
    

    你将做好出发的准备。