Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.2
-
Fix Version/s: 2.0.9, 3.0-alpha-1
-
Component/s: Bootstrap & Build
-
Labels:None
-
Environment:WXP
-
Complexity:Intermediate
-
Number of attachments :
Description
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\..\..
Issue Links
| This issue relates to: | ||||
| MNG-2989 | M2_HOME is incorrect when launched from another process |
|
|
|
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..