Skip to content

Commit e5df4cf

Browse files
authored
Springboot-Multiple-DataStructure
1 parent 8c07d59 commit e5df4cf

File tree

20 files changed

+1297
-0
lines changed

20 files changed

+1297
-0
lines changed
+322
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,322 @@
1+
#!/bin/sh
2+
# ----------------------------------------------------------------------------
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# https://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
# ----------------------------------------------------------------------------
20+
21+
# ----------------------------------------------------------------------------
22+
# Maven Start Up Batch script
23+
#
24+
# Required ENV vars:
25+
# ------------------
26+
# JAVA_HOME - location of a JDK home dir
27+
#
28+
# Optional ENV vars
29+
# -----------------
30+
# M2_HOME - location of maven2's installed home dir
31+
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
32+
# e.g. to debug Maven itself, use
33+
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34+
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35+
# ----------------------------------------------------------------------------
36+
37+
if [ -z "$MAVEN_SKIP_RC" ]; then
38+
39+
if [ -f /etc/mavenrc ]; then
40+
. /etc/mavenrc
41+
fi
42+
43+
if [ -f "$HOME/.mavenrc" ]; then
44+
. "$HOME/.mavenrc"
45+
fi
46+
47+
fi
48+
49+
# OS specific support. $var _must_ be set to either true or false.
50+
cygwin=false
51+
darwin=false
52+
mingw=false
53+
case "$(uname)" in
54+
CYGWIN*) cygwin=true ;;
55+
MINGW*) mingw=true ;;
56+
Darwin*)
57+
darwin=true
58+
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
59+
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
60+
if [ -z "$JAVA_HOME" ]; then
61+
if [ -x "/usr/libexec/java_home" ]; then
62+
export JAVA_HOME="$(/usr/libexec/java_home)"
63+
else
64+
export JAVA_HOME="/Library/Java/Home"
65+
fi
66+
fi
67+
;;
68+
esac
69+
70+
if [ -z "$JAVA_HOME" ]; then
71+
if [ -r /etc/gentoo-release ]; then
72+
JAVA_HOME=$(java-config --jre-home)
73+
fi
74+
fi
75+
76+
if [ -z "$M2_HOME" ]; then
77+
## resolve links - $0 may be a link to maven's home
78+
PRG="$0"
79+
80+
# need this for relative symlinks
81+
while [ -h "$PRG" ]; do
82+
ls=$(ls -ld "$PRG")
83+
link=$(expr "$ls" : '.*-> \(.*\)$')
84+
if expr "$link" : '/.*' >/dev/null; then
85+
PRG="$link"
86+
else
87+
PRG="$(dirname "$PRG")/$link"
88+
fi
89+
done
90+
91+
saveddir=$(pwd)
92+
93+
M2_HOME=$(dirname "$PRG")/..
94+
95+
# make it fully qualified
96+
M2_HOME=$(cd "$M2_HOME" && pwd)
97+
98+
cd "$saveddir"
99+
# echo Using m2 at $M2_HOME
100+
fi
101+
102+
# For Cygwin, ensure paths are in UNIX format before anything is touched
103+
if $cygwin; then
104+
[ -n "$M2_HOME" ] &&
105+
M2_HOME=$(cygpath --unix "$M2_HOME")
106+
[ -n "$JAVA_HOME" ] &&
107+
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
108+
[ -n "$CLASSPATH" ] &&
109+
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
110+
fi
111+
112+
# For Mingw, ensure paths are in UNIX format before anything is touched
113+
if $mingw; then
114+
[ -n "$M2_HOME" ] &&
115+
M2_HOME="$( (
116+
cd "$M2_HOME"
117+
pwd
118+
))"
119+
[ -n "$JAVA_HOME" ] &&
120+
JAVA_HOME="$( (
121+
cd "$JAVA_HOME"
122+
pwd
123+
))"
124+
fi
125+
126+
if [ -z "$JAVA_HOME" ]; then
127+
javaExecutable="$(which javac)"
128+
if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then
129+
# readlink(1) is not available as standard on Solaris 10.
130+
readLink=$(which readlink)
131+
if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then
132+
if $darwin; then
133+
javaHome="$(dirname \"$javaExecutable\")"
134+
javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac"
135+
else
136+
javaExecutable="$(readlink -f \"$javaExecutable\")"
137+
fi
138+
javaHome="$(dirname \"$javaExecutable\")"
139+
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
140+
JAVA_HOME="$javaHome"
141+
export JAVA_HOME
142+
fi
143+
fi
144+
fi
145+
146+
if [ -z "$JAVACMD" ]; then
147+
if [ -n "$JAVA_HOME" ]; then
148+
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
149+
# IBM's JDK on AIX uses strange locations for the executables
150+
JAVACMD="$JAVA_HOME/jre/sh/java"
151+
else
152+
JAVACMD="$JAVA_HOME/bin/java"
153+
fi
154+
else
155+
JAVACMD="$(which java)"
156+
fi
157+
fi
158+
159+
if [ ! -x "$JAVACMD" ]; then
160+
echo "Error: JAVA_HOME is not defined correctly." >&2
161+
echo " We cannot execute $JAVACMD" >&2
162+
exit 1
163+
fi
164+
165+
if [ -z "$JAVA_HOME" ]; then
166+
echo "Warning: JAVA_HOME environment variable is not set."
167+
fi
168+
169+
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
170+
171+
# traverses directory structure from process work directory to filesystem root
172+
# first directory with .mvn subdirectory is considered project base directory
173+
find_maven_basedir() {
174+
175+
if [ -z "$1" ]; then
176+
echo "Path not specified to find_maven_basedir"
177+
return 1
178+
fi
179+
180+
basedir="$1"
181+
wdir="$1"
182+
while [ "$wdir" != '/' ]; do
183+
if [ -d "$wdir"/.mvn ]; then
184+
basedir=$wdir
185+
break
186+
fi
187+
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
188+
if [ -d "${wdir}" ]; then
189+
wdir=$(
190+
cd "$wdir/.."
191+
pwd
192+
)
193+
fi
194+
# end of workaround
195+
done
196+
echo "${basedir}"
197+
}
198+
199+
# concatenates all lines of a file
200+
concat_lines() {
201+
if [ -f "$1" ]; then
202+
echo "$(tr -s '\n' ' ' <"$1")"
203+
fi
204+
}
205+
206+
BASE_DIR=$(find_maven_basedir "$(pwd)")
207+
if [ -z "$BASE_DIR" ]; then
208+
exit 1
209+
fi
210+
211+
##########################################################################################
212+
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
213+
# This allows using the maven wrapper in projects that prohibit checking in binary data.
214+
##########################################################################################
215+
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
216+
if [ "$MVNW_VERBOSE" = true ]; then
217+
echo "Found .mvn/wrapper/maven-wrapper.jar"
218+
fi
219+
else
220+
if [ "$MVNW_VERBOSE" = true ]; then
221+
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
222+
fi
223+
if [ -n "$MVNW_REPOURL" ]; then
224+
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
225+
else
226+
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
227+
fi
228+
while IFS="=" read key value; do
229+
case "$key" in wrapperUrl)
230+
jarUrl="$value"
231+
break
232+
;;
233+
esac
234+
done <"$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
235+
if [ "$MVNW_VERBOSE" = true ]; then
236+
echo "Downloading from: $jarUrl"
237+
fi
238+
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
239+
if $cygwin; then
240+
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
241+
fi
242+
243+
if command -v wget >/dev/null; then
244+
if [ "$MVNW_VERBOSE" = true ]; then
245+
echo "Found wget ... using wget"
246+
fi
247+
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
248+
wget "$jarUrl" -O "$wrapperJarPath"
249+
else
250+
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
251+
fi
252+
elif command -v curl >/dev/null; then
253+
if [ "$MVNW_VERBOSE" = true ]; then
254+
echo "Found curl ... using curl"
255+
fi
256+
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
257+
curl -o "$wrapperJarPath" "$jarUrl" -f
258+
else
259+
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
260+
fi
261+
262+
else
263+
if [ "$MVNW_VERBOSE" = true ]; then
264+
echo "Falling back to using Java to download"
265+
fi
266+
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
267+
# For Cygwin, switch paths to Windows format before running javac
268+
if $cygwin; then
269+
javaClass=$(cygpath --path --windows "$javaClass")
270+
fi
271+
if [ -e "$javaClass" ]; then
272+
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
273+
if [ "$MVNW_VERBOSE" = true ]; then
274+
echo " - Compiling MavenWrapperDownloader.java ..."
275+
fi
276+
# Compiling the Java class
277+
("$JAVA_HOME/bin/javac" "$javaClass")
278+
fi
279+
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
280+
# Running the downloader
281+
if [ "$MVNW_VERBOSE" = true ]; then
282+
echo " - Running MavenWrapperDownloader.java ..."
283+
fi
284+
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
285+
fi
286+
fi
287+
fi
288+
fi
289+
##########################################################################################
290+
# End of extension
291+
##########################################################################################
292+
293+
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
294+
if [ "$MVNW_VERBOSE" = true ]; then
295+
echo $MAVEN_PROJECTBASEDIR
296+
fi
297+
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
298+
299+
# For Cygwin, switch paths to Windows format before running java
300+
if $cygwin; then
301+
[ -n "$M2_HOME" ] &&
302+
M2_HOME=$(cygpath --path --windows "$M2_HOME")
303+
[ -n "$JAVA_HOME" ] &&
304+
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
305+
[ -n "$CLASSPATH" ] &&
306+
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
307+
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
308+
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
309+
fi
310+
311+
# Provide a "standardized" way to retrieve the CLI args that will
312+
# work with both Windows and non-Windows executions.
313+
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
314+
export MAVEN_CMD_LINE_ARGS
315+
316+
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
317+
318+
exec "$JAVACMD" \
319+
$MAVEN_OPTS \
320+
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
321+
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
322+
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

0 commit comments

Comments
 (0)