0

I got following error when try to compile and package PlayFramework (version 1.3.1) application on my Jenkins server:

Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (play-precompile) on project my-project: Command execution failed. Process exited with an error: 255 (Exit value: 255) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (play-precompile) on project my-project: Command execution failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
    at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:133)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:68)
    at hudson.remoting.UserRequest.perform(UserRequest.java:153)
    at hudson.remoting.UserRequest.perform(UserRequest.java:50)
    at hudson.remoting.Request$2.run(Request.java:332)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.MojoExecutionException: Command execution failed.
    at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:362)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 31 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 255 (Exit value: 255)
    at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:377)
    at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:610)
    at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:352)
    ... 33 more
[ERROR] 
[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

Here is my plugin configuration in pom.xml:

<plugins>
    <plugin>
        <artifactId>exec-maven-plugin</artifactId>
        <groupId>org.codehaus.mojo</groupId>
        <version>1.2.1</version>
        <executions>
            <execution>
                <id>play-dependencies</id>
                <phase>generate-sources</phase>
                <goals>
                    <goal>exec</goal>
                </goals>
                <configuration>
                    <executable>play</executable>
                    <arguments>
                        <argument>dependencies</argument>
                        <argument>--sync</argument>
                        <argument>--forceCopy</argument>
                    </arguments>
                </configuration>
            </execution>
            <execution>
                <id>play-precompile</id>
                <phase>compile</phase>
                <goals>
                    <goal>exec</goal>
                </goals>
                <configuration>
                    <executable>play</executable>
                    <arguments>
                        <argument>precompile</argument>
                    </arguments>
                </configuration>
            </execution>
            <execution>
                <id>play-clean</id>
                <phase>clean</phase>
                <goals>
                    <goal>exec</goal>
                </goals>
                <configuration>
                    <executable>rm</executable>
                    <arguments>
                        <argument>-fr</argument>
                        <argument>${project.basedir}/tmp</argument>
                        <argument>${project.basedir}/lib</argument>
                        <argument>${project.basedir}/precompiled</argument>
                        <argument>${project.basedir}/modules</argument>
                    </arguments>
                </configuration>
            </execution>
        </executions>
    </plugin>
    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.2</version>
        <configuration>
            <appendAssemblyId>false</appendAssemblyId>
            <descriptors>
                <descriptor>maven/assembly.xml</descriptor>
            </descriptors>
            <finalName>${project.artifactId}-${project.version}.r${buildNumber}</finalName>
            <outputDirectory>target</outputDirectory>
        </configuration>
        <executions>
            <execution>
                <id>build-assembly</id>
                <phase>package</phase>
                <goals>
                    <goal>single</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>1.1</version>
        <executions>
            <execution>
                <phase>validate</phase>
                <goals>
                    <goal>create</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <doCheck>false</doCheck>
            <doUpdate>false</doUpdate>
        </configuration>
    </plugin>
</plugins>

So anyone having idea about that? I seem that error code 255 and the error message is too general and I dont know how to continuing investigate.

Notes: When I run mvn clean package on my local machine, It run well and I could get archive .zip file normally. I compared play dependencies in /lib folder, they are the same in both environments (Jenkins server and my local machine)

marcospereira
  • 12,045
  • 3
  • 46
  • 52
Chiến Nghê
  • 736
  • 2
  • 9
  • 25

1 Answers1

0

I didn't see your project, but since you are using Play! 1.x with Maven, you can try Play! Framework 1.x Maven Plugin.

It defines "play" packaging and executes most commands in-process (without JVM forking), so you should always see what the real problem is in the stacktrace, not eg. error code 255.

There are multiple example projects. You can start from checking them.