[MNG-3930] mvn.bat doesn't handle ampersand in Windows user name properly

o Merged from r728264

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@728267 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2008-12-20 11:08:27 +00:00
parent 088b7c6241
commit 922ace51f8
2 changed files with 14 additions and 14 deletions

View File

@ -38,7 +38,7 @@
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME @REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%) if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one @REM Execute a user defined script before this one
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
@ -64,7 +64,7 @@ if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory. echo ERROR: JAVA_HOME is set to an invalid directory.
echo JAVA_HOME = %JAVA_HOME% echo JAVA_HOME = "%JAVA_HOME%"
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation echo location of your Java installation
echo. echo.
@ -73,8 +73,8 @@ goto error
:chkMHome :chkMHome
if not "%M2_HOME%"=="" goto valMHome if not "%M2_HOME%"=="" goto valMHome
if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0.. if "%OS%"=="Windows_NT" SET "M2_HOME=%~dp0.."
if "%OS%"=="WINNT" SET M2_HOME=%~dp0.. if "%OS%"=="WINNT" SET "M2_HOME=%~dp0.."
if not "%M2_HOME%"=="" goto valMHome if not "%M2_HOME%"=="" goto valMHome
echo. echo.
@ -87,8 +87,8 @@ goto error
:valMHome :valMHome
:stripMHome :stripMHome
if not _%M2_HOME:~-1%==_\ goto checkMBat if not "_%M2_HOME:~-1%"=="_\" goto checkMBat
set M2_HOME=%M2_HOME:~0,-1% set "M2_HOME=%M2_HOME:~0,-1%"
goto stripMHome goto stripMHome
:checkMBat :checkMBat
@ -96,7 +96,7 @@ if exist "%M2_HOME%\bin\mvn.bat" goto init
echo. echo.
echo ERROR: M2_HOME is set to an invalid directory. echo ERROR: M2_HOME is set to an invalid directory.
echo M2_HOME = %M2_HOME% echo M2_HOME = "%M2_HOME%"
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
echo location of the Maven installation echo location of the Maven installation
echo. echo.

View File

@ -41,7 +41,7 @@ set INT_MAVEN_OPTS=%MAVEN_OPTS% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME @REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%) if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one @REM Execute a user defined script before this one
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
@ -67,7 +67,7 @@ if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory. echo ERROR: JAVA_HOME is set to an invalid directory.
echo JAVA_HOME = %JAVA_HOME% echo JAVA_HOME = "%JAVA_HOME%"
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation echo location of your Java installation
echo. echo.
@ -76,8 +76,8 @@ goto error
:chkMHome :chkMHome
if not "%M2_HOME%"=="" goto valMHome if not "%M2_HOME%"=="" goto valMHome
if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0.. if "%OS%"=="Windows_NT" SET "M2_HOME=%~dp0.."
if "%OS%"=="WINNT" SET M2_HOME=%~dp0.. if "%OS%"=="WINNT" SET "M2_HOME=%~dp0.."
if not "%M2_HOME%"=="" goto valMHome if not "%M2_HOME%"=="" goto valMHome
echo. echo.
@ -90,8 +90,8 @@ goto error
:valMHome :valMHome
:stripMHome :stripMHome
if not _%M2_HOME:~-1%==_\ goto checkMBat if not "_%M2_HOME:~-1%"=="_\" goto checkMBat
set M2_HOME=%M2_HOME:~0,-1% set "M2_HOME=%M2_HOME:~0,-1%"
goto stripMHome goto stripMHome
:checkMBat :checkMBat
@ -99,7 +99,7 @@ if exist "%M2_HOME%\bin\mvn.bat" goto init
echo. echo.
echo ERROR: M2_HOME is set to an invalid directory. echo ERROR: M2_HOME is set to an invalid directory.
echo M2_HOME = %M2_HOME% echo M2_HOME = "%M2_HOME%"
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
echo location of the Maven installation echo location of the Maven installation
echo. echo.