work without M2_HOME - base on location of batch file

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163157 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2004-09-24 14:48:18 +00:00
parent d24fa87cb6
commit 6e812f1d2e
1 changed files with 4 additions and 1 deletions

View File

@ -20,9 +20,9 @@
@REM @REM
@REM Required ENV vars: @REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir @REM JAVA_HOME - location of a JDK home dir
@REM M2_HOME - location of maven2's installed home dir
@REM @REM
@REM Optional ENV vars @REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@ -67,6 +67,9 @@ goto end
:chkMHome :chkMHome
if not "%M2_HOME%"=="" goto valMHome if not "%M2_HOME%"=="" goto valMHome
if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0\..
if not "%M2_HOME%"=="" goto valMHome
echo. echo.
echo ERROR: M2_HOME not found in your environment. echo ERROR: M2_HOME not found in your environment.
echo Please set the M2_HOME variable in your environment to match the echo Please set the M2_HOME variable in your environment to match the