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 " $@ "
0 commit comments