forked from sleberrigaud/mvnsh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mvnsh.bat
80 lines (58 loc) · 1.89 KB
/
mvnsh.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
@rem .
@rem Copyright (c) 2009-2011 Sonatype, Inc.
@rem All rights reserved. This program and the accompanying materials
@rem are made available under the terms of the Eclipse Public License v1.0
@rem and Apache License v2.0 which accompanies this distribution.
@rem The Eclipse Public License is available at
@rem http://www.eclipse.org/legal/epl-v10.html
@rem The Apache License v2.0 is available at
@rem http://www.apache.org/licenses/LICENSE-2.0.html
@rem You may elect to redistribute this code under either of these licenses.
@rem .
@if "%SHELL_DEBUG%" == "" @echo off
if "%OS%"=="Windows_NT" setlocal enableextensions
:begin
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.\
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
set BOOTSCRIPT="%HOME%\.m2\mvnsh.boot.bat"
if exist "%BOOTSCRIPT%" call "%BOOTSCRIPT%"
:check_JAVACMD
if not "%JAVACMD%" == "" goto check_SHELL_HOME
:check_JAVA_HOME
if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
set JAVACMD=java
goto check_SHELL_HOME
:have_JAVA_HOME
set JAVACMD=%JAVA_HOME%\bin\java
goto check_SHELL_HOME
:check_SHELL_HOME
if "%SHELL_HOME%" == "" set SHELL_HOME=%DIRNAME%..
:init
@REM Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%eval[2+2]" == "4" goto 4NT_args
@REM Regular WinNT shell
set ARGS=%*
goto execute
:win9xME_args
@REM Slurp the command line arguments. This loop allows for an unlimited number
set ARGS=
:win9xME_args_slurp
if "x%1" == "x" goto execute
set ARGS=%ARGS% %1
shift
goto win9xME_args_slurp
:4NT_args
@REM Get arguments from the 4NT Shell from JP Software
set ARGS=%$
:execute
set BOOTJAR=%SHELL_HOME%\boot\bootstrap.jar
set COMMAND=
@REM Start the JVM
"%JAVACMD%" %JAVA_OPTS% -jar "%BOOTJAR%" %COMMAND% %ARGS%
:end
if "%OS%"=="Windows_NT" endlocal
if "%SHELL_BATCH_PAUSE%" == "on" pause
if "%SHELL_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
cmd /C exit /B %ERRORLEVEL%