maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brett Porter (JIRA)" <j...@codehaus.org>
Subject [jira] Closed: (MRELEASE-18) mvn.bat does not properly return the exit code of the java process
Date Mon, 03 Apr 2006 23:30:44 GMT
     [ http://jira.codehaus.org/browse/MRELEASE-18?page=all ]
     
Brett Porter closed MRELEASE-18:
--------------------------------

     Assign To: Brett Porter
    Resolution: Won't Fix

not a release plugin bug. Is fixed in recent versions of Maven.

> mvn.bat does not properly return the exit code of the java process
> ------------------------------------------------------------------
>
>          Key: MRELEASE-18
>          URL: http://jira.codehaus.org/browse/MRELEASE-18
>      Project: Maven 2.x Release Plugin
>         Type: Bug

>     Reporter: David Hawkins
>     Assignee: Brett Porter
>  Attachments: MNG-1632-maven-core-2.patch, MNG-1632-maven-core.patch
>
>
> This manifests itself when running release:perform and an error occurs in the child process.
 The stdout shows a build error for the child process, but a shows build success for the outer
process.  This is pretty confusing if you only happen to look at the last message.
> This patch also makes mvn.bat return the error code properly to when running within cygwin.

> Detailed explanation: The problem is that running mvn.bat within cygwin, you are actually
running cmd.exe which then executes mvn.bat.  The exit code returned to the calling application
is actually the exit code from the execution of cmd.exe, not the .bat script executed within
it.  In order to get the exit code all the way out to the calling application, you have to
omit the /b when calling exit. ("exit 0" vs. "exit /b 0").  When calling exit without the
/b, the cmd prompt window (if any) will actually exit, so mvn.bat makes sure it is a batch
script whose execution originated in a cygwin shell.  If it originated in cygwin, it uses
"exit" else it uses "exit /b".

-- 
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


Mime
View raw message