首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装时,Android-Maven未能执行org.codehaus.mojoto目标

安装时,Android-Maven未能执行org.codehaus.mojoto目标
EN

Stack Overflow用户
提问于 2013-10-13 03:54:04
回答 2查看 1.9K关注 0票数 2

我正在使用新的Android包和Android建立一个新的Android开发。

$ANDROID_HOME/Users/allanhahaha/Documents/adt-bundle-mac-x86_64-20130917/sdk

当我在mvn clean install -X文件夹中运行maven-android-sdk-deployer-master时,我得到了以下错误:

代码语言:javascript
复制
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.966s
[INFO] Finished at: Sat Oct 12 20:34:27 PDT 2013
[INFO] Final Memory: 11M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties (default) on project android-3: Properties file not found: /Users/allanhahaha/Documents/adt-bundle-mac-x86_64-20130917/sdk/platforms/android-3/source.properties -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :android-3

下面是一些额外的错误消息:

代码语言:javascript
复制
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties (default) on project android-3: Properties file not found: /Users/allanhahaha/Documents/adt-bundle-mac-x86_64-20130917/sdk/platforms/android-3/source.properties

我觉得很奇怪,因为我甚至没有android-3文件夹:

代码语言:javascript
复制
ALLAN-MacBook-Pro:platforms allanhahaha$ pwd
/Users/allanhahaha/Documents/adt-bundle-mac-x86_64-20130917/sdk/platforms
ALLAN-MacBook-Pro:platforms allanhahaha$ ls -l
total 0
drwxr-xr-x  11 allanhahaha  staff  374 Oct 12 18:15 android-10
drwxr-xr-x  12 allanhahaha  staff  408 Oct 12 18:14 android-11
drwxr-xr-x  12 allanhahaha  staff  408 Oct 12 18:13 android-12
drwxr-xr-x  12 allanhahaha  staff  408 Oct 12 18:12 android-13
drwxr-xr-x  10 allanhahaha  staff  340 Oct 12 18:10 android-14
drwxr-xr-x  10 allanhahaha  staff  340 Oct 12 18:10 android-15
drwxr-xr-x  11 allanhahaha  staff  374 Oct 12 18:10 android-16
drwxr-xr-x  11 allanhahaha  staff  374 Oct 12 18:09 android-17
drwxrwx---@ 11 allanhahaha  staff  374 Sep 10 11:56 android-18
drwxr-xr-x  11 allanhahaha  staff  374 Oct 12 18:16 android-8

下面是我的POM.xml配置的一部分:

代码语言:javascript
复制
<build>
<pluginManagement>
  <plugins>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>properties-maven-plugin</artifactId>
      <version>1.0-alpha-2</version>
    </plugin>
    <plugin>
      <groupId>com.jayway.maven.plugins.android.generation2</groupId>
      <artifactId>android-maven-plugin</artifactId>
      <version>3.6.0</version>
      <configuration>
        <sdk>
          <platform>${android.sdk.platform}</platform>
        </sdk>
      </configuration>
    </plugin>
  </plugins>
</pluginManagement>
<extensions>
  <extension>
    <groupId>org.apache.maven.wagon</groupId>
    <artifactId>wagon-webdav-jackrabbit</artifactId>
    <version>2.4</version>
  </extension>
</extensions>

我对maven并不熟悉,所以不知道这个错误消息是怎么回事。请帮忙看一下。谢谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-10-13 17:36:46

我仍然不知道为什么会出现这种情况,但似乎打开Android并重新安装包含错误的包可能会有所帮助(在我的示例中,安装Android 1.5(API 3)包括SDK平台和Google ),并再次运行mvn安装程序。

票数 1
EN

Stack Overflow用户

发布于 2013-10-16 18:25:40

ANDROID_HOME必须指向你的Android,而不是ADT。

例如,我用

代码语言:javascript
复制
export $ANDROID_HOME=/opt/tools/android-sdk-mac_86
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19341685

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档