forked from Archives/Athou_commafeed
fix mvnw on windows
This commit is contained in:
37
mvnw.bat
37
mvnw.bat
@@ -24,7 +24,6 @@
|
|||||||
@REM JAVA_HOME - location of a JDK home dir
|
@REM JAVA_HOME - location of a JDK 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
|
||||||
@@ -66,7 +65,7 @@ echo.
|
|||||||
goto error
|
goto error
|
||||||
|
|
||||||
:OkJHome
|
:OkJHome
|
||||||
if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome
|
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||||
@@ -76,38 +75,6 @@ echo location of your Java installation. >&2
|
|||||||
echo.
|
echo.
|
||||||
goto error
|
goto error
|
||||||
|
|
||||||
:chkMHome
|
|
||||||
if not "%M2_HOME%"=="" goto valMHome
|
|
||||||
|
|
||||||
SET "M2_HOME=%~dp0.."
|
|
||||||
if not "%M2_HOME%"=="" goto valMHome
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Error: M2_HOME not found in your environment. >&2
|
|
||||||
echo Please set the M2_HOME variable in your environment to match the >&2
|
|
||||||
echo location of the Maven installation. >&2
|
|
||||||
echo.
|
|
||||||
goto error
|
|
||||||
|
|
||||||
:valMHome
|
|
||||||
|
|
||||||
:stripMHome
|
|
||||||
if not "_%M2_HOME:~-1%"=="_\" goto checkMCmd
|
|
||||||
set "M2_HOME=%M2_HOME:~0,-1%"
|
|
||||||
goto stripMHome
|
|
||||||
|
|
||||||
:checkMCmd
|
|
||||||
if exist "%M2_HOME%\bin\mvn.cmd" goto init
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Error: M2_HOME is set to an invalid directory. >&2
|
|
||||||
echo M2_HOME = "%M2_HOME%" >&2
|
|
||||||
echo Please set the M2_HOME variable in your environment to match the >&2
|
|
||||||
echo location of the Maven installation >&2
|
|
||||||
echo.
|
|
||||||
goto error
|
|
||||||
@REM ==== END VALIDATION ====
|
|
||||||
|
|
||||||
:init
|
:init
|
||||||
|
|
||||||
set MAVEN_CMD_LINE_ARGS=%*
|
set MAVEN_CMD_LINE_ARGS=%*
|
||||||
@@ -149,7 +116,7 @@ for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do s
|
|||||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\maven\maven-wrapper.jar"
|
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\maven\maven-wrapper.jar"
|
||||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
|
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% %WRAPPER_LAUNCHER% -Dmaven.multiModuleProjectDirectory=" %MAVEN_CMD_LINE_ARGS%
|
||||||
|
|
||||||
if ERRORLEVEL 1 goto error
|
if ERRORLEVEL 1 goto error
|
||||||
goto end
|
goto end
|
||||||
|
|||||||
Reference in New Issue
Block a user