[ 
http://jira.codehaus.org/browse/MEXEC-88?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=253903#action_253903
 ] 

Michael Mraz commented on MEXEC-88:
-----------------------------------

I'll work on recreating the patch and adding a unit test.

The asynch support was required to restore the capture of the return code from 
the underlying application as the synchronous executor in commons-exec doesn't 
have that functionality and a failure is being caught generically in the 
exeception handler of the executor without an opportunity to act on the value.  
The asynchronous executor has the ability to trap and process the return code 
from what it's executing.  So, to restore the broken functionality described in 
this issue adding access to the asynch executor in commons-exec was required.

> ExecMojo: SuccessCodes config seems not to be recognized by commons exec 
> framework
> ----------------------------------------------------------------------------------
>
>                 Key: MEXEC-88
>                 URL: http://jira.codehaus.org/browse/MEXEC-88
>             Project: Maven 2.x Exec Plugin
>          Issue Type: Bug
>          Components: exec
>    Affects Versions: 1.2
>            Reporter: Daniel Strassenburg
>            Priority: Blocker
>         Attachments: ExecMojo.java.patch
>
>
> I used the successCodes config to tell the exec-mojo not to fail in case of 
> error codes e.g. 0,1,2,3. Unfortunately, the maven build fails with the 
> exception below.
> Excerpt from mojo config:
> {noformat}
> [DEBUG]   (f) basedir = build/basedir
> [DEBUG]   (f) classpathScope = runtime
> [DEBUG]   (f) executable = path/to/executable
> [DEBUG]   (f) longClasspath = false
> [DEBUG]   (f) project = MavenProject: <my-maven-project>\pom.xml
> [DEBUG]   (f) session = org.apache.maven.execution.MavenSession@dab859
> [DEBUG]   (f) skip = false
> [DEBUG]   (s) successCodes = [0, 1, 2, 3]
> [DEBUG] -- end configuration --
> {noformat}
> I had a look at the plugin's source code ({{ExecMojo}}) and suppose that the 
> underlying framework (commons exec) is not configured with these success 
> codes. The commons exec framework throws an {{ExecuteException}}, see stack 
> trace
> {noformat}
> org.apache.maven.lifecycle.LifecycleExecutionException: Command execution 
> failed.
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
>       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>       at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>       at 
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:597)
>       at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>       at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Command execution 
> failed.
>       at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:345)
>       at 
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>       at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>       ... 17 more
> Caused by: org.apache.commons.exec.ExecuteException: Process exited with an 
> error: 2(Exit value: 2)
>       at 
> org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:346)
>       at 
> org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:149)
>       at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:589)
>       at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:335)
>       ... 19 more
> {noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to