[ http://jira.codehaus.org/browse/MNG-2127?page=comments#action_60507 ] 

Steve Loughran commented on MNG-2127:
-------------------------------------

I believe Ant's return code on winnt systems was fixed as of last week. We 
really need to think of a good regression test for this, because ant.bat is the 
one of the two startup scripts that scare the team. the other is cygwin support 
in ant.sh. the perl and python startup scripts are fine, its just those two.

the underlying problem with ant.bat is trying to support win9x, which makes 
things much more contrived, and much more brittle -we have a vmware image of 
'9x around just to check things work. 

as for last weeks patch, it turns out that if you unset an env variable that 
was never set, the error code was set. So to clear all env variables (remember, 
you can't use @setlocal on '9x), ant needs to set every transient env var to a 
value just before clearing, to be 100% sure that is was set by all paths to the 
exit logic.

If starting maven on ant is important (and clearly it is), I would recomend you 
look at the script and do a <java> task to set it up and call it. That or 
someone needs to write a proper <maven> task. 

> mvn.bat always exits 0 on Windows 2000 and higher
> -------------------------------------------------
>
>          Key: MNG-2127
>          URL: http://jira.codehaus.org/browse/MNG-2127
>      Project: Maven 2
>         Type: Bug

>   Components: Command Line
>     Versions: 2.0, 2.0.1, 2.0.2
>  Environment: I'm on Windows 2003 Server, but this will affect any OS for 
> which the %OS% environment variable is Windows_NT, including Windows XP and 
> Windows 2000.
>     Reporter: Dan Fabulich
>     Assignee: Brett Porter
>     Priority: Blocker
>  Attachments: mvnfixed.bat, mvnfixed.bat
>
>
> Write the following ant script and run it on Windows 2000 or higher:  
> <project default="main"><target  name="main"><exec executable="mvn.bat" 
> failonerror="true" /></target></project>
> This will run "mvn" with no arguments, which will always fail.  But the ant 
> script will claim "build successful", because the exit value of mvn.bat was 
> 0.  It is absolutely critical that this work correctly, or else I can't 
> integrate Maven into any other automated system.
> This is happening because mvn.bat is improperly abusing local scoping.  On 
> line 130 of mvn.bat, we execute maven, but we don't do anything with its exit 
> value... we just always goto end.  The fix for this is to add a line 131 that 
> says "if errorlevel 1 goto error", which will behave correctly.
> (I marked this as having a test case because I've included a test ant script, 
> but technically this isn't a JUnit test case, so it may be an inappropriate 
> use of the "testcase included" marker.)

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

Reply via email to