Skip to content

Commit 6686d1c

Browse files
committed
Added maven-wrapper (mvnw)
1 parent 6594271 commit 6686d1c

File tree

4 files changed

+264
-0
lines changed

4 files changed

+264
-0
lines changed

.mvn/wrapper/maven-wrapper.jar

50.9 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
distributionUrl=https://repository.apache.org/content/repositories/releases/org/apache/maven/apache-maven/3.2.5/apache-maven-3.2.5-bin.zip

mvnw

+155
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
#!/bin/bash
2+
#
3+
# The Maven Wrapper 0.1.0 (https://github.com/shyiko/mvnw).
4+
# Based on https://github.com/gradle/gradle/blob/62925785791e2487c43d19d234c2fced6d750412/gradlew.
5+
#
6+
7+
# Add default JVM options here. You can also use JAVA_OPTS and MAVEN_OPTS to pass JVM options to this script.
8+
DEFAULT_JVM_OPTS="-Dfile.encoding=UTF-8"
9+
10+
APP_BASE_NAME=`basename "$0"`
11+
12+
# Use the maximum available, or set MAX_FD != -1 to use that value.
13+
MAX_FD="maximum"
14+
15+
warn ( ) {
16+
echo "$*"
17+
}
18+
19+
die ( ) {
20+
echo
21+
echo "$*"
22+
echo
23+
exit 1
24+
}
25+
26+
# OS specific support (must be 'true' or 'false').
27+
cygwin=false
28+
msys=false
29+
darwin=false
30+
case "`uname`" in
31+
CYGWIN* )
32+
cygwin=true
33+
;;
34+
Darwin* )
35+
darwin=true
36+
;;
37+
MINGW* )
38+
msys=true
39+
;;
40+
esac
41+
42+
# For Cygwin, ensure paths are in UNIX format before anything is touched.
43+
if $cygwin ; then
44+
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
45+
fi
46+
47+
# Attempt to set APP_HOME
48+
# Resolve links: $0 may be a link
49+
PRG="$0"
50+
# Need this for relative symlinks.
51+
while [ -h "$PRG" ] ; do
52+
ls=`ls -ld "$PRG"`
53+
link=`expr "$ls" : '.*-> \(.*\)$'`
54+
if expr "$link" : '/.*' > /dev/null; then
55+
PRG="$link"
56+
else
57+
PRG=`dirname "$PRG"`"/$link"
58+
fi
59+
done
60+
SAVED="`pwd`"
61+
cd "`dirname \"$PRG\"`/"
62+
APP_HOME="`pwd -P`"
63+
cd "$SAVED"
64+
65+
CLASSPATH=$APP_HOME/.mvn/wrapper/maven-wrapper.jar
66+
67+
# Determine the Java command to use to start the JVM.
68+
if [ -n "$JAVA_HOME" ] ; then
69+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
70+
# IBM's JDK on AIX uses strange locations for the executables
71+
JAVACMD="$JAVA_HOME/jre/sh/java"
72+
else
73+
JAVACMD="$JAVA_HOME/bin/java"
74+
fi
75+
if [ ! -x "$JAVACMD" ] ; then
76+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
77+
78+
Please set the JAVA_HOME variable in your environment to match the
79+
location of your Java installation."
80+
fi
81+
else
82+
JAVACMD="java"
83+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
84+
85+
Please set the JAVA_HOME variable in your environment to match the
86+
location of your Java installation."
87+
fi
88+
89+
# Increase the maximum file descriptors if we can.
90+
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
91+
MAX_FD_LIMIT=`ulimit -H -n`
92+
if [ $? -eq 0 ] ; then
93+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
94+
MAX_FD="$MAX_FD_LIMIT"
95+
fi
96+
ulimit -n $MAX_FD
97+
if [ $? -ne 0 ] ; then
98+
warn "Could not set maximum file descriptor limit: $MAX_FD"
99+
fi
100+
else
101+
warn "Could not query businessSystem maximum file descriptor limit: $MAX_FD_LIMIT"
102+
fi
103+
fi
104+
105+
# For Cygwin, switch paths to Windows format before running java
106+
if $cygwin ; then
107+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
108+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
109+
110+
# We build the pattern for arguments to be converted via cygpath
111+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
112+
SEP=""
113+
for dir in $ROOTDIRSRAW ; do
114+
ROOTDIRS="$ROOTDIRS$SEP$dir"
115+
SEP="|"
116+
done
117+
OURCYGPATTERN="(^($ROOTDIRS))"
118+
# Add a user-defined pattern to the cygpath arguments
119+
if [ "$MAVEN_CYGPATTERN" != "" ] ; then
120+
OURCYGPATTERN="$OURCYGPATTERN|($MAVEN_CYGPATTERN)"
121+
fi
122+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
123+
i=0
124+
for arg in "$@" ; do
125+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
126+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
127+
128+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
129+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
130+
else
131+
eval `echo args$i`="\"$arg\""
132+
fi
133+
i=$((i+1))
134+
done
135+
case $i in
136+
(0) set -- ;;
137+
(1) set -- "$args0" ;;
138+
(2) set -- "$args0" "$args1" ;;
139+
(3) set -- "$args0" "$args1" "$args2" ;;
140+
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
141+
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
142+
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
143+
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
144+
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
145+
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
146+
esac
147+
fi
148+
149+
# taken from https://github.com/takari/maven-wrapper/blob/69f3c6dd1b07620f28c1fc8cb20e392afcd9e95b/mvnw
150+
ld() { if [ -f "$1" ]; then echo "$(tr -s '\n' ' ' < "$1")"; fi }
151+
152+
JVM_CONFIG="$(ld "$APP_HOME/.mvn/jvm.config")"
153+
MAVEN_CONFIG="$(ld "$APP_HOME/.mvn/maven.config")"
154+
155+
exec "$JAVACMD" $DEFAULT_JVM_OPTS $JVM_CONFIG $JAVA_OPTS $MAVEN_OPTS -classpath "$CLASSPATH" -Dmaven.multiModuleProjectDirectory="$APP_HOME" org.apache.maven.wrapper.MavenWrapperMain $MAVEN_CONFIG "$@"

mvnw.bat

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
@if "%DEBUG%" == "" @echo off
2+
@rem
3+
@rem The Maven Wrapper 0.1.0 (https://github.com/shyiko/mvnw).
4+
@rem Based on https://github.com/gradle/gradle/blob/62925785791e2487c43d19d234c2fced6d750412/gradlew.bat.
5+
@rem
6+
7+
@rem Set local scope for the variables with windows NT shell
8+
if "%OS%"=="Windows_NT" setlocal
9+
10+
@rem Add default JVM options here. You can also use JAVA_OPTS and MAVEN_OPTS to pass JVM options to this script.
11+
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8
12+
13+
set DIRNAME=%~dp0
14+
if "%DIRNAME%" == "" set DIRNAME=.
15+
set APP_BASE_NAME=%~n0
16+
set APP_HOME=%DIRNAME%
17+
18+
@rem Find java.exe
19+
if defined JAVA_HOME goto findJavaFromJavaHome
20+
21+
set JAVA_EXE=java.exe
22+
%JAVA_EXE% -version >NUL 2>&1
23+
if "%ERRORLEVEL%" == "0" goto init
24+
25+
echo.
26+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
27+
echo.
28+
echo Please set the JAVA_HOME variable in your environment to match the
29+
echo location of your Java installation.
30+
31+
goto fail
32+
33+
:findJavaFromJavaHome
34+
set JAVA_HOME=%JAVA_HOME:"=%
35+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
36+
37+
if exist "%JAVA_EXE%" goto init
38+
39+
echo.
40+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
41+
echo.
42+
echo Please set the JAVA_HOME variable in your environment to match the
43+
echo location of your Java installation.
44+
45+
goto fail
46+
47+
:init
48+
@rem Get command-line arguments, handling Windowz variants
49+
50+
if not "%OS%" == "Windows_NT" goto win9xME_args
51+
if "%@eval[2+2]" == "4" goto 4NT_args
52+
53+
:win9xME_args
54+
@rem Slurp the command line arguments.
55+
set CMD_LINE_ARGS=
56+
set _SKIP=2
57+
58+
:win9xME_args_slurp
59+
if "x%~1" == "x" goto execute
60+
61+
set CMD_LINE_ARGS=%*
62+
goto execute
63+
64+
:4NT_args
65+
@rem Get arguments from the 4NT Shell from JP Software
66+
set CMD_LINE_ARGS=%$
67+
68+
:execute
69+
70+
@rem taken from https://github.com/takari/maven-wrapper/blob/69f3c6dd1b07620f28c1fc8cb20e392afcd9e95b/mvnw
71+
72+
IF NOT EXIST "%APP_HOME%\.mvn\jvm.config" goto endReadJvmConfig
73+
74+
@setlocal EnableExtensions EnableDelayedExpansion
75+
for /F "usebackq delims=" %%a in ("%APP_HOME%\.mvn\jvm.config") do set JVM_CONFIG=!JVM_CONFIG! %%a
76+
@endlocal & set JVM_CONFIG=%JVM_CONFIG%
77+
78+
:endReadJvmConfig
79+
80+
IF NOT EXIST "%APP_HOME%\.mvn\maven.config" goto endReadMavenConfig
81+
82+
@setlocal EnableExtensions EnableDelayedExpansion
83+
for /F "usebackq delims=" %%a in ("%APP_HOME%\.mvn\maven.config") do set MAVEN_CONFIG=!MAVEN_CONFIG! %%a
84+
@endlocal & set MAVEN_CONFIG=%MAVEN_CONFIG%
85+
86+
:endReadMavenConfig
87+
88+
@rem Setup the command line
89+
90+
set CLASSPATH=%APP_HOME%\.mvn\wrapper\maven-wrapper.jar
91+
92+
@rem Execute Maven
93+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JVM_CONFIG% %JAVA_OPTS% %MAVEN_OPTS% -classpath "%CLASSPATH%" -Dmaven.multiModuleProjectDirectory="%APP_HOME%" org.apache.maven.wrapper.MavenWrapperMain %MAVEN_CONFIG% %CMD_LINE_ARGS%
94+
95+
:end
96+
@rem End local scope for the variables with windows NT shell
97+
if "%ERRORLEVEL%"=="0" goto mainEnd
98+
99+
:fail
100+
rem Set variable MAVEN_EXIT_CONSOLE if you need the _script_ return code instead of
101+
rem the _cmd.exe /c_ return code!
102+
if not "" == "%MAVEN_EXIT_CONSOLE%" exit 1
103+
exit /b 1
104+
105+
:mainEnd
106+
if "%OS%"=="Windows_NT" endlocal
107+
108+
:omega

0 commit comments

Comments
 (0)