简体   繁体   中英

Error when generating sources : org.apache.maven.plugin.MojoExecutionException:

When I run the maven project in Jenkins, I am getting the following error. I am new to this maven project, any help will be appreciated. Thank you

[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.614s
[INFO] Finished at: Tue Sep 08 11:56:39 IST 2015
[INFO] Final Memory: 16M/491M
[INFO] ------------------------------------------------------------------------
 [ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project PowerMeter: MojoExecutionException: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C "D:\android-sdks\build-tools\23.0.0_rc3\aapt.exe package -f --no-crunch -I D:\android-sdks\platforms\android-22\android.jar -M E:\Jenkin\.jenkins\jobs\powermeter\workspace\PowerMeter\AndroidManifest.xml -S E:\Jenkin\.jenkins\jobs\powermeter\workspace\PowerMeter\res -A E:\Jenkin\.jenkins\jobs\powermeter\workspace\PowerMeter\target\generated-sources\combined-assets\assets -m -J E:\Jenkin\.jenkins\jobs\powermeter\workspace\PowerMeter\target\generated-sources\r --output-text-symbols E:\Jenkin\.jenkins\jobs\powermeter\workspace\PowerMeter\target --auto-add-overlay", Result = 1 -> [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
[JENKINS] Archiving E:\Jenkin\.jenkins\jobs\powermeter\workspace\PowerMeter\pom.xml to com.maetree.powermeter/PowerMeter/2.0.0/PowerMeter-2.0.0.pom
channel stopped

I have my pom.xml content below

 <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.maetree.powermeter</groupId>
 <artifactId>PowerMeter</artifactId>
 <packaging>apk</packaging>
 <version>2.0.0</version>
 <name>app_name</name>
 <url>http://maven.apache.org</url>



 <profiles>
    <profile>

        <id>local</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
             <app.version.code>2</app.version.code>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <platform.version>5.1.1</platform.version>

            <android.plugin.version>3.8.2</android.plugin.version>
            <projectVersion>2.0.0</projectVersion>
            <packagingType>apk</packagingType>
            <android.maven.version>3.8.2</android.maven.version>
            <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>D:\android-sdks</android.sdk.path>
        </properties>

    </profile>


</profiles> 

<build>


<plugins>


    <plugin>
        <groupId>com.jayway.maven.plugins.android.generation2</groupId>
        <artifactId>android-maven-plugin</artifactId>
         <version>3.8.2</version>

        <extensions>true</extensions>

        <configuration>

                <sdk>

                    <platform>22</platform>
                    <path>D:\android-sdks</path>

                </sdk>

                <emulator>
                    <avd>demodevice</avd>
                    <wait>100000</wait>
                    <options>-no-skin</options>
            </emulator>
            <zipalign>
                <verbose>true</verbose>
            </zipalign>
            <deleteConflictingFiles>true</deleteConflictingFiles>
            <undeployBeforeDeploy>true</undeployBeforeDeploy>
        </configuration>

    </plugin>
    <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-compiler-plugin</artifactId> 
        <version>3.1</version> 
        <configuration> 
        <encoding>UTF-8</encoding> 
        <source>1.7</source> 
        <target>1.7</target> 
        </configuration> 
    </plugin>


</plugins>

</build>

<dependencies>
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>3.8.1</version>
  <scope>test</scope>
</dependency>

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




</dependencies>
</project>

This is the first time i am using maven project

Its says it can't execute D:\\android-sdks\\build-tools\\23.0.0_rc3\\aapt.exe. Have you tried running that full command from the command line?

DId you try running maven locally?

This is not a jenkins problem. This is your maven build failing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM