From 6e812f1d2ef713c98f32f05e43a7a76a2d3fcdcb Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Fri, 24 Sep 2004 14:48:18 +0000 Subject: [PATCH] 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 --- maven-core/src/bin/m2.bat | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/maven-core/src/bin/m2.bat b/maven-core/src/bin/m2.bat index 276fd82666..628ce34012 100644 --- a/maven-core/src/bin/m2.bat +++ b/maven-core/src/bin/m2.bat @@ -20,9 +20,9 @@ @REM @REM Required ENV vars: @REM JAVA_HOME - location of a JDK home dir -@REM M2_HOME - location of maven2's installed home dir @REM @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_PAUSE - set to 'on' to wait for a key stroke before ending @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven @@ -67,6 +67,9 @@ goto end :chkMHome if not "%M2_HOME%"=="" goto valMHome +if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0\.. +if not "%M2_HOME%"=="" goto valMHome + echo. echo ERROR: M2_HOME not found in your environment. echo Please set the M2_HOME variable in your environment to match the