首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法执行目标com.jayway.maven.plugins.android.generation2:android-maven-plugin

无法执行目标com.jayway.maven.plugins.android.generation2:android-maven-plugin
EN

Stack Overflow用户
提问于 2014-02-27 16:56:32
回答 3查看 3.3K关注 0票数 5

我想要一个简单的安卓hello world程序与maven.here是我的pom.xml文件

代码语言:javascript
复制
<?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>com.example.androidmaven</groupId>
<artifactId>gs-maven-android</artifactId>
<version>0.1.0</version>
<packaging>apk</packaging>

<dependencies>
    <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>android</artifactId>
        <version>4.1.1.4</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <version>3.8.2</version>
            <configuration>
                <sdk>
                    <platform>19</platform>
                </sdk>
                <deleteConflictingFiles>true</deleteConflictingFiles>
                <undeployBeforeDeploy>true</undeployBeforeDeploy>
            </configuration>
            <extensions>true</extensions>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
</build>

获取此错误

代码语言:javascript
复制
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:andr
oid-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project gs
-maven-android: Execution default-generate-sources of goal com.jayway.maven.plug
ins.android.generation2:android-maven-plugin:3.8.2:generate-sources failed: Erro
r reading D:\adt-bundle-windows-x86-20130522\sdk\tools\tools\source.properties -
> [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/PluginExecutio
nException
EN

回答 3

Stack Overflow用户

发布于 2014-04-14 04:26:20

当我从jenkins运行时,我也得到了相同的错误。请参考以下内容

代码语言:javascript
复制
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project helloflashlight: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources failed: Error reading /home/iosmia/tools/android-sdk-linux/tools/source.properties -> [Help 1]

注意:我可以使用命令行成功运行以下命令

代码语言:javascript
复制
mvn install

更新:

我可以意识到读取文件的权限如下所示:

代码语言:javascript
复制
iosmia@iosmia-linux:~/tools/android-sdk-linux/tools$ ls -l source.properties 
-rw-rw---- 1 iosmia iosmia 70 Mar 22 01:47 source.properties

这意味着,jenkins是“其他”用户,所以它无法读取该文件。在像下面这样给了所有人读权限后,我就能够成功构建了。

代码语言:javascript
复制
iosmia@iosmia-linux:~/tools/android-sdk-linux/tools$ chmod 777 source.properties 
iosmia@iosmia-linux:~/tools/android-sdk-linux/tools$ ls -l source.properties 
-rwxrwxrwx 1 iosmia iosmia 70 Mar 22 01:47 source.properties
票数 0
EN

Stack Overflow用户

发布于 2014-05-04 02:50:31

我也遇到过同样的问题,现在可以通过安装Swig来解决。我使用的是MAC,下面是安装Swig的步骤。

代码语言:javascript
复制
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

通过运行brew安装swig来安装swig,然后运行

代码语言:javascript
复制
mvn install

它解决了我的问题,也希望它能解决你的问题。

票数 0
EN

Stack Overflow用户

发布于 2014-09-04 22:53:24

虽然我不知道到底是什么问题,但从日志中我发现很奇怪,从D:\adt-bundle-windows-x86-20130522\sdk\tools\tools\source.properties.读取source.properties的插件我认为正确的道路应该是...\sdk\tools\source.properties。

您可以尝试以下位置,看看是否有问题:

1.Eclipse: Windows |首选项| Android | SDK位置

2. ANDROID_HOME的2.Windows环境变量

票数 -3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22063509

复制
相关文章

相似问题

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