Maven的无法执行的目标com.jayway.maven.plugins.android.generation2 [英] Maven Failed to execute goal com.jayway.maven.plugins.android.generation2

查看:405
本文介绍了Maven的无法执行的目标com.jayway.maven.plugins.android.generation2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在maven.here一个简单的Andr​​oid Hello World程序是我pom.xml文件

 <?XML版本=1.0编码=UTF-8&GT?;
<项目的xmlns =htt​​p://maven.apache.org/POM/4.0.0的xmlns:XSI =htt​​p://www.w3.org/2001/XMLSchema-instance
    XSI:的schemaLocation =htt​​p://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">
    < modelVersion> 4.0.0< / modelVersion>
    <&的groupId GT; appzoyfoo141< /的groupId>
    <&的artifactId GT; ekanta< / artifactId的>
    <&版GT; 1.0.0< /版本>
    <包装和GT;&APK LT; /包装>
    <名称>&ekanta LT; /名称>    <性状>
        < project.build.sourceEncoding> UTF-8< /project.build.sourceEncoding>
        < platform.version> 4.1.1.4< /platform.version>
        < android.plugin.version> 3.1.1< /android.plugin.version>
    < /性状>    <依赖和GT;
        <&依赖性GT;
            <&的groupId GT; com.google.android< /的groupId>
            <&的artifactId GT; Android和LT; / artifactId的>
            <&版GT; 4.1.1.4< /版本>
            <&范围GT;及提供LT; /&范围GT;
        < /依赖性>
    < /依赖和GT;
    <建立>
        < finalName> $ {project.artifactId}< / finalName>
        < pluginManagement>
            <&插件GT;
                <&插件GT;
                    <&的groupId GT; com.jayway.maven.plugins.android.generation2< /的groupId>
                    <&的artifactId GT; Android的Maven的插件< / artifactId的>
                    <&版GT; $ {android.plugin.version}< /版本>
                    <附加功能,GT;真< /扩展>
                < /插件>
            < /插件>
        < / pluginManagement>
        <&插件GT;
            <&插件GT;
                <&的groupId GT; com.jayway.maven.plugins.android.generation2< /的groupId>
                <&的artifactId GT; Android的Maven的插件< / artifactId的>
                <结构>
                    < SDK开发及GT;
                        <平台和GT; 17< /平台>
                        <路径> $ {ANDROID_HOME}< /路径>
                    < / SDK>
                < /结构>
            < /插件>
        < /插件>
    < /构建>
< /项目>

但试图运行pom.xml中单击鼠标右键pom.xml-> runas->行家test..getting此错误

 未能执行目标com.jayway.maven.plugins.android.generation2`..Can有人plz帮助me..thanks我收到此错误console` [INFO]  - -------------------------------------------------- ---------------------
[INFO]构建失败
[INFO] ----------------------------------------------- -------------------------
[INFO]总时间:0.613s
[INFO]在表面处理:周四09年1月14点47分46秒2014年IST
[INFO]最后的记忆:6M / 15M
[INFO] ----------------------------------------------- -------------------------
[错误]未能执行目标com.jayway.maven.plugins.android.generation2:Android的Maven的插件:3.1.1:产生来源(默认生成来源)项目ekanta:没有Android SDK中的路径可寻。你可以使用&LT在POM文件的插件配置部分进行配置; SDK><路径> ...< /路径>< / SDK>或LT;性状>< android.sdk.path> ...< /android.sdk.path>< /性状>或者在命令行中使用-Dandroid.sdk.path = ...或通过设置环境变量ANDROID_HOME - > [求助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,重新运行Maven与-e开关。
[错误]使用-X开关启用完全调试日志记录重新运行Maven。
[错误]
[错误]有关错误和可能的解决方案,请阅读以下文章了解更多信息:
[错误] [说明1]的http:// cwiki.apache.org /汇合/显示/ MAVEN / MojoExecutionException`


解决方案

我碰到了,试图构建Android项目引导时com.jayway.maven插件同样的问题。结果
我可以通过进入pom.xml的性能部分并加入我的Andr​​oid SDK中的路径来解决这个问题。

 <性状>
    < abs.version> 4.3.1< /abs.version>
    < dagger.version> 1.0.1< /dagger.version>
    < otto.version> 1.3.4< /otto.version>
    < gson.version> 2.2.4< /gson.version>
    < menudrawer.version> 3.0.2< /menudrawer.version>
    < android.sdk.path> C:\\ Android的\\ ADT-束Windows的x86_64-20131030 \\ SDK< /android.sdk.path>
< /性状>

我原本就指着我的JAVA SDK这是导致它失败 - 你需要点给你的Andr​​oid SDK中

I want a simple android hello world program in with maven.here is my pom.xml file

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>appzoyfoo141</groupId>
    <artifactId>ekanta</artifactId>
    <version>1.0.0</version>
    <packaging>apk</packaging>
    <name>ekanta</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <platform.version>4.1.1.4</platform.version>
        <android.plugin.version>3.1.1</android.plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android</artifactId>
            <version>4.1.1.4</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <finalName>${project.artifactId}</finalName>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                    <artifactId>android-maven-plugin</artifactId>
                    <version>${android.plugin.version}</version>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <configuration>
                    <sdk>
                        <platform>17</platform>
                        <path>${ANDROID_HOME}</path>
                    </sdk>
                </configuration>
            </plugin>   
        </plugins>
    </build>
</project>

But while trying to run the pom.xml rightclick pom.xml->runas->maven test..getting this error

Failed to execute goal com.jayway.maven.plugins.android.generation2`..Can anybody plz help me..thanks  i am getting this error in console`[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.613s
[INFO] Finished at: Thu Jan 09 14:47:46 IST 2014
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources (default-generate-sources) on project ekanta: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME -> [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`

解决方案

I ran into the same problem with the com.jayway.maven plugin when trying to build Android Bootstrap project.
I was able to fix this by going into pom.xml properties section and adding my ANDROID sdk path.

<properties>
    <abs.version>4.3.1</abs.version>
    <dagger.version>1.0.1</dagger.version>
    <otto.version>1.3.4</otto.version>
    <gson.version>2.2.4</gson.version>
    <menudrawer.version>3.0.2</menudrawer.version>
    <android.sdk.path>C:\Android\adt-bundle-windows-x86_64-20131030\sdk</android.sdk.path>
</properties>

I originally had it pointing to my JAVA SDK which was causing it to fail -- you need to point this to your ANDROID sdk.

这篇关于Maven的无法执行的目标com.jayway.maven.plugins.android.generation2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆