123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- @echo off
- @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
- if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
- if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
- if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
- if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
- :skipRcPre
- @setlocal
- set ERROR_CODE=0
- @setlocal
- if not "%JAVA_HOME%" == "" goto OkJHome
- echo.
- echo Error: JAVA_HOME not found in your environment. >&2
- echo Please set the JAVA_HOME variable in your environment to match the >&2
- echo location of your Java installation. >&2
- echo.
- goto error
- :OkJHome
- if exist "%JAVA_HOME%\bin\java.exe" goto init
- echo.
- echo Error: JAVA_HOME is set to an invalid directory. >&2
- echo JAVA_HOME = "%JAVA_HOME%" >&2
- echo Please set the JAVA_HOME variable in your environment to match the >&2
- echo location of your Java installation. >&2
- echo.
- goto error
- :init
- set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
- IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
- set EXEC_DIR=%CD%
- set WDIR=%EXEC_DIR%
- :findBaseDir
- IF EXIST "%WDIR%"\.mvn goto baseDirFound
- cd ..
- IF "%WDIR%"=="%CD%" goto baseDirNotFound
- set WDIR=%CD%
- goto findBaseDir
- :baseDirFound
- set MAVEN_PROJECTBASEDIR=%WDIR%
- cd "%EXEC_DIR%"
- goto endDetectBaseDir
- :baseDirNotFound
- set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
- cd "%EXEC_DIR%"
- :endDetectBaseDir
- IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
- @setlocal EnableExtensions EnableDelayedExpansion
- for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
- @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
- :endReadAdditionalConfig
- SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
- set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
- set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
- %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
- if ERRORLEVEL 1 goto error
- goto end
- :error
- set ERROR_CODE=1
- :end
- @endlocal & set ERROR_CODE=%ERROR_CODE%
- if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
- if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
- if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
- :skipRcPost
- if "%MAVEN_BATCH_PAUSE%" == "on" pause
- if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
- exit /B %ERROR_CODE%
|