You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Thai Ha (JIRA)" <ji...@codehaus.org> on 2006/04/06 05:01:55 UTC

[jira] Commented: (MNG-2178) incorrect M2_HOME guess in mvn.bat

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

Thai Ha commented on MNG-2178:
------------------------------

I believe that this issue should be fixed as below:

if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0..

This fix should be applied to Maven 2.0.3 too because Maven 2.0.3 is using (%~dp0\..) and the slash is redundant.

Note:
If you have Ant 1.6.5, you can open ant.bat and see (line 25) set DEFAULT_ANT_HOME=%~dp0..



> incorrect M2_HOME guess in mvn.bat
> ----------------------------------
>
>          Key: MNG-2178
>          URL: http://jira.codehaus.org/browse/MNG-2178
>      Project: Maven 2
>         Type: Bug

>   Components: Bootstrap & Build
>     Versions: 2.0.2
>  Environment: WXP
>     Reporter: Jörg Henne

>
>
> mvn.bat contains the following lines:
> :chkMHome
> if not "%M2_HOME%"=="" goto valMHome
> if "%OS%"=="Windows_NT" SET M2_HOME=%~dps0\..
> if not "%M2_HOME%"=="" goto valMHome
> Guessing M2_HOME=%~dps0\.. leads to complaints later on, since the script expects m2.bat in bin/...:
> if exist "%M2_HOME%\bin\m2.bat" goto init
> Hence, the line should read:
> if "%OS%"=="Windows_NT" SET M2_HOME=%~dps0\..\..

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