You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Dan Fabulich (JIRA)" <ji...@codehaus.org> on 2006/03/06 23:52:22 UTC

[jira] Created: (MNG-2127) mvn.bat always exits 0 on Windows 2000 and higher

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
    Priority: Blocker


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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-2127) mvn.bat always exits 0 on Windows 2000 and higher

Posted by "Emmanuel Venisse (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2127?page=comments#action_60317 ] 

Emmanuel Venisse commented on MNG-2127:
---------------------------------------

We can't use on by default because when you activate this env var with 'on', mvn exit with /B so the command line is closed, and if you use it in a dos environment, your window would be closed too.

Ypu can try it like this :
SET MAVEN_TERMINATE_CMD=on
mvn.bat


> 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
>     Priority: Blocker

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Updated: (MNG-2127) mvn.bat always exits 0 on Windows 2000 and higher

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2127?page=all ]

Dan Fabulich updated MNG-2127:
------------------------------

    Attachment: mvnfixed.bat

> 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
>      Fix For: 2.0.3
>  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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-2127) mvn.bat always exits 0 on Windows 2000 and higher

Posted by "Wayne Fay (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2127?page=comments#action_60316 ] 

Wayne Fay commented on MNG-2127:
--------------------------------

Any particular reason this isn't ON by default?

It makes no sense to me that this needs to be turned ON when it seems like normal behavoir for commandline utilities in any Operating system. But there is probably a good reason why this is off for Windows, and I just don't know enough to realize why...

> 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
>     Priority: Blocker

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Reopened: (MNG-2127) mvn.bat always exits 0 on Windows 2000 and higher

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2127?page=all ]
     
Brett Porter reopened MNG-2127:
-------------------------------


> 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
>     Priority: Blocker

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Updated: (MNG-2127) mvn.bat always exits 0 on Windows 2000 and higher

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2127?page=all ]

Brett Porter updated MNG-2127:
------------------------------

      Assign To: Brett Porter
    Fix Version: 2.0.3

will investigate

> 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
>      Fix For: 2.0.3

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-2127) mvn.bat always exits 0 on Windows 2000 and higher

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2127?page=comments#action_60416 ] 

Dan Fabulich commented on MNG-2127:
-----------------------------------

Thanks for re-opening this.  I've just discovered that Emmanuel's workaround doesn't work either, because *that* makes mvn.bat *always* exit with error code 1, even if the build succeeds!

Also note that my one-line fix needs to be added to all of the other validation points in this file, including the JAVA_HOME and M2_HOME verification checks.  I'm attaching a new batch file to this issue which I believe fixes the problem.

> 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
>      Fix For: 2.0.3

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Closed: (MNG-2127) mvn.bat always exits 0 on Windows 2000 and higher

Posted by "Emmanuel Venisse (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2127?page=all ]
     
Emmanuel Venisse closed MNG-2127:
---------------------------------

    Resolution: Won't Fix

You must set MAVEN_TERMINATE_CMD env var to 'on' : 

<project default="main">
  <target name="main">
    <exec executable="mvn.bat" failonerror="true">
      <env key="MAVEN_TERMINATE_CMD" value="on" />
    </exec>
  </target>
</project>


> 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
>     Priority: Blocker

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-2127) mvn.bat always exits 0 on Windows 2000 and higher

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2127?page=comments#action_60419 ] 

Dan Fabulich commented on MNG-2127:
-----------------------------------

Oops, sorry... it's not that it *always* fails with Emmanuel's workaround; the problem with mvn.bat right now is that if it ever fails, it sets the ERROR_CODE=1, (not the DOS official env var %ERRORLEVEL%, but an arbitrary env var) which means that the script will always fail from then on.

I'm updating my mvnfixed.bat file with enhancements to make this go away.  I've tested this on Windows 2003 and Windows NT, but not on Win9x.  It works great everywhere I've tried it.  Note that I've added this sneaky line to set the Windows errorlevel: "echo 1 | choice /c:12 /n >nul >2&1".  I got this from here: http://www.robvanderwoude.com/index.html

He claims this works on Win9x, but I don't have Win9x available.

> 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
>      Fix For: 2.0.3
>  Attachments: 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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-2127) mvn.bat always exits 0 on Windows 2000 and higher

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2127?page=comments#action_60368 ] 

Dan Fabulich commented on MNG-2127:
-----------------------------------

This undocumented environment variable is totally unnecessary in a batch script... we shouldn't be using exit /B like that.  All that's needed is the one-line fix I proposed in the bug description.  I've filed an improvement MNG-2132 to highlight this.

> 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
>     Priority: Blocker

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Updated: (MNG-2127) mvn.bat always exits 0 on Windows 2000 and higher

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2127?page=all ]

Dan Fabulich updated MNG-2127:
------------------------------

    Attachment: mvnfixed.bat

> 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
>      Fix For: 2.0.3
>  Attachments: 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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-2127) mvn.bat always exits 0 on Windows 2000 and higher

Posted by "Wayne Fay (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2127?page=comments#action_60319 ] 

Wayne Fay commented on MNG-2127:
--------------------------------

Like I said... "I just don't know enough to realize why" ;-)

Thanks Emmanuel

> 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
>     Priority: Blocker

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org