expert 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +15 -0
- data/History.txt +3 -0
- data/README.md +0 -0
- data/Rakefile +18 -0
- data/bin/expert +4 -0
- data/expert.gemspec +19 -0
- data/lib/expert.rb +76 -0
- data/lib/expert/classpath_file.rb +27 -0
- data/lib/expert/cli.rb +21 -0
- data/lib/expert/environment.rb +51 -0
- data/lib/expert/jar_dependency.rb +17 -0
- data/lib/expert/jarfile.rb +40 -0
- data/lib/expert/jarfile_parser.rb +81 -0
- data/lib/expert/jarfile_tokenizer.rb +41 -0
- data/lib/expert/maven.rb +28 -0
- data/lib/expert/pom_file.rb +97 -0
- data/lib/expert/version.rb +5 -0
- data/vendor/apache-maven-3.3.3/LICENSE +305 -0
- data/vendor/apache-maven-3.3.3/NOTICE +8 -0
- data/vendor/apache-maven-3.3.3/README.txt +79 -0
- data/vendor/apache-maven-3.3.3/bin/m2.conf +8 -0
- data/vendor/apache-maven-3.3.3/bin/mvn +232 -0
- data/vendor/apache-maven-3.3.3/bin/mvn.cmd +176 -0
- data/vendor/apache-maven-3.3.3/bin/mvnDebug +41 -0
- data/vendor/apache-maven-3.3.3/bin/mvnDebug.cmd +31 -0
- data/vendor/apache-maven-3.3.3/bin/mvnyjp +42 -0
- data/vendor/apache-maven-3.3.3/boot/plexus-classworlds-2.5.2.jar +0 -0
- data/vendor/apache-maven-3.3.3/conf/logging/simplelogger.properties +25 -0
- data/vendor/apache-maven-3.3.3/conf/settings.xml +257 -0
- data/vendor/apache-maven-3.3.3/conf/toolchains.xml +103 -0
- data/vendor/apache-maven-3.3.3/lib/aether-api-1.0.2.v20150114.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/aether-api.license +261 -0
- data/vendor/apache-maven-3.3.3/lib/aether-connector-basic-1.0.2.v20150114.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/aether-connector-basic.license +261 -0
- data/vendor/apache-maven-3.3.3/lib/aether-impl-1.0.2.v20150114.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/aether-impl.license +261 -0
- data/vendor/apache-maven-3.3.3/lib/aether-spi-1.0.2.v20150114.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/aether-spi.license +261 -0
- data/vendor/apache-maven-3.3.3/lib/aether-transport-wagon-1.0.2.v20150114.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/aether-transport-wagon.license +261 -0
- data/vendor/apache-maven-3.3.3/lib/aether-util-1.0.2.v20150114.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/aether-util.license +261 -0
- data/vendor/apache-maven-3.3.3/lib/aopalliance-1.0.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/cdi-api-1.0.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/cdi-api.license +389 -0
- data/vendor/apache-maven-3.3.3/lib/commons-cli-1.2.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/commons-io-2.2.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/commons-lang-2.6.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/ext/README.txt +2 -0
- data/vendor/apache-maven-3.3.3/lib/guava-18.0.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/javax.inject-1.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/jsoup-1.7.2.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/jsoup.license +65 -0
- data/vendor/apache-maven-3.3.3/lib/jsr250-api-1.0.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/jsr250-api.license +406 -0
- data/vendor/apache-maven-3.3.3/lib/maven-aether-provider-3.3.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/maven-aether-provider.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/maven-artifact-3.3.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/maven-artifact.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/maven-builder-support-3.3.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/maven-builder-support.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/maven-compat-3.3.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/maven-compat.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/maven-core-3.3.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/maven-core.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/maven-embedder-3.3.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/maven-embedder.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/maven-model-3.3.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/maven-model-builder-3.3.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/maven-model-builder.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/maven-model.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/maven-plugin-api-3.3.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/maven-plugin-api.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/maven-repository-metadata-3.3.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/maven-repository-metadata.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/maven-settings-3.3.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/maven-settings-builder-3.3.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/maven-settings-builder.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/maven-settings.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/org.eclipse.sisu.inject-0.3.0.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/org.eclipse.sisu.inject.license +261 -0
- data/vendor/apache-maven-3.3.3/lib/org.eclipse.sisu.plexus-0.3.0.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/org.eclipse.sisu.plexus.license +261 -0
- data/vendor/apache-maven-3.3.3/lib/plexus-cipher-1.7.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/plexus-cipher.license +389 -0
- data/vendor/apache-maven-3.3.3/lib/plexus-component-annotations-1.5.5.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/plexus-interpolation-1.21.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/plexus-sec-dispatcher-1.3.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/plexus-sec-dispatcher.license +389 -0
- data/vendor/apache-maven-3.3.3/lib/plexus-utils-3.0.20.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/sisu-guice-3.2.5-no_aop.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/slf4j-api-1.7.5.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/slf4j-api.license +191 -0
- data/vendor/apache-maven-3.3.3/lib/slf4j-simple-1.7.5.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/slf4j-simple.license +191 -0
- data/vendor/apache-maven-3.3.3/lib/wagon-file-2.9.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/wagon-file.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/wagon-http-2.9-shaded.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/wagon-http-shared-2.9.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/wagon-http-shared.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/wagon-http.license +202 -0
- data/vendor/apache-maven-3.3.3/lib/wagon-provider-api-2.9.jar +0 -0
- data/vendor/apache-maven-3.3.3/lib/wagon-provider-api.license +202 -0
- metadata +148 -0
@@ -0,0 +1,232 @@
|
|
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
|
+
# http://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
|
+
# Maven2 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*) darwin=true
|
57
|
+
#
|
58
|
+
# Look for the Apple JDKs first to preserve the existing behaviour, and then look
|
59
|
+
# for the new JDKs provided by Oracle.
|
60
|
+
#
|
61
|
+
if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then
|
62
|
+
#
|
63
|
+
# Apple JDKs
|
64
|
+
#
|
65
|
+
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
|
66
|
+
fi
|
67
|
+
|
68
|
+
if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then
|
69
|
+
#
|
70
|
+
# Apple JDKs
|
71
|
+
#
|
72
|
+
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
|
73
|
+
fi
|
74
|
+
|
75
|
+
if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then
|
76
|
+
#
|
77
|
+
# Oracle JDKs
|
78
|
+
#
|
79
|
+
export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
|
80
|
+
fi
|
81
|
+
|
82
|
+
if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then
|
83
|
+
#
|
84
|
+
# Apple JDKs
|
85
|
+
#
|
86
|
+
export JAVA_HOME=`/usr/libexec/java_home`
|
87
|
+
fi
|
88
|
+
;;
|
89
|
+
esac
|
90
|
+
|
91
|
+
if [ -z "$JAVA_HOME" ] ; then
|
92
|
+
if [ -r /etc/gentoo-release ] ; then
|
93
|
+
JAVA_HOME=`java-config --jre-home`
|
94
|
+
fi
|
95
|
+
fi
|
96
|
+
|
97
|
+
if [ -z "$M2_HOME" ] ; then
|
98
|
+
## resolve links - $0 may be a link to maven's home
|
99
|
+
PRG="$0"
|
100
|
+
|
101
|
+
# need this for relative symlinks
|
102
|
+
while [ -h "$PRG" ] ; do
|
103
|
+
ls=`ls -ld "$PRG"`
|
104
|
+
link=`expr "$ls" : '.*-> \(.*\)$'`
|
105
|
+
if expr "$link" : '/.*' > /dev/null; then
|
106
|
+
PRG="$link"
|
107
|
+
else
|
108
|
+
PRG="`dirname "$PRG"`/$link"
|
109
|
+
fi
|
110
|
+
done
|
111
|
+
|
112
|
+
saveddir=`pwd`
|
113
|
+
|
114
|
+
M2_HOME=`dirname "$PRG"`/..
|
115
|
+
|
116
|
+
# make it fully qualified
|
117
|
+
M2_HOME=`cd "$M2_HOME" && pwd`
|
118
|
+
|
119
|
+
cd "$saveddir"
|
120
|
+
# echo Using m2 at $M2_HOME
|
121
|
+
fi
|
122
|
+
|
123
|
+
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
124
|
+
if $cygwin ; then
|
125
|
+
[ -n "$M2_HOME" ] &&
|
126
|
+
M2_HOME=`cygpath --unix "$M2_HOME"`
|
127
|
+
[ -n "$JAVA_HOME" ] &&
|
128
|
+
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
129
|
+
[ -n "$CLASSPATH" ] &&
|
130
|
+
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
131
|
+
fi
|
132
|
+
|
133
|
+
# For Migwn, ensure paths are in UNIX format before anything is touched
|
134
|
+
if $mingw ; then
|
135
|
+
[ -n "$M2_HOME" ] &&
|
136
|
+
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
137
|
+
[ -n "$JAVA_HOME" ] &&
|
138
|
+
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
139
|
+
# TODO classpath?
|
140
|
+
fi
|
141
|
+
|
142
|
+
if [ -z "$JAVA_HOME" ]; then
|
143
|
+
javaExecutable="`which javac`"
|
144
|
+
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
145
|
+
# readlink(1) is not available as standard on Solaris 10.
|
146
|
+
readLink=`which readlink`
|
147
|
+
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
148
|
+
if $darwin ; then
|
149
|
+
javaHome="`dirname \"$javaExecutable\"`"
|
150
|
+
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
151
|
+
else
|
152
|
+
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
153
|
+
fi
|
154
|
+
javaHome="`dirname \"$javaExecutable\"`"
|
155
|
+
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
156
|
+
JAVA_HOME="$javaHome"
|
157
|
+
export JAVA_HOME
|
158
|
+
fi
|
159
|
+
fi
|
160
|
+
fi
|
161
|
+
|
162
|
+
if [ -z "$JAVACMD" ] ; then
|
163
|
+
if [ -n "$JAVA_HOME" ] ; then
|
164
|
+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
165
|
+
# IBM's JDK on AIX uses strange locations for the executables
|
166
|
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
167
|
+
else
|
168
|
+
JAVACMD="$JAVA_HOME/bin/java"
|
169
|
+
fi
|
170
|
+
else
|
171
|
+
JAVACMD="`which java`"
|
172
|
+
fi
|
173
|
+
fi
|
174
|
+
|
175
|
+
if [ ! -x "$JAVACMD" ] ; then
|
176
|
+
echo "Error: JAVA_HOME is not defined correctly." >&2
|
177
|
+
echo " We cannot execute $JAVACMD" >&2
|
178
|
+
exit 1
|
179
|
+
fi
|
180
|
+
|
181
|
+
if [ -z "$JAVA_HOME" ] ; then
|
182
|
+
echo "Warning: JAVA_HOME environment variable is not set."
|
183
|
+
fi
|
184
|
+
|
185
|
+
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
186
|
+
|
187
|
+
# For Cygwin, switch paths to Windows format before running java
|
188
|
+
if $cygwin; then
|
189
|
+
[ -n "$M2_HOME" ] &&
|
190
|
+
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
191
|
+
[ -n "$JAVA_HOME" ] &&
|
192
|
+
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
193
|
+
[ -n "$CLASSPATH" ] &&
|
194
|
+
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
195
|
+
fi
|
196
|
+
|
197
|
+
# traverses directory structure from process work directory to filesystem root
|
198
|
+
# first directory with .mvn subdirectory is considered project base directory
|
199
|
+
find_maven_basedir() {
|
200
|
+
local basedir=$(pwd)
|
201
|
+
local wdir=$(pwd)
|
202
|
+
while [ "$wdir" != '/' ] ; do
|
203
|
+
wdir=$(cd "$wdir/.."; pwd)
|
204
|
+
if [ -d "$wdir"/.mvn ] ; then
|
205
|
+
basedir=$wdir
|
206
|
+
break
|
207
|
+
fi
|
208
|
+
done
|
209
|
+
echo "${basedir}"
|
210
|
+
}
|
211
|
+
|
212
|
+
# concatenates all lines of a file
|
213
|
+
concat_lines() {
|
214
|
+
if [ -f "$1" ]; then
|
215
|
+
echo "$(tr -s '\n' ' ' < "$1")"
|
216
|
+
fi
|
217
|
+
}
|
218
|
+
|
219
|
+
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
|
220
|
+
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
221
|
+
|
222
|
+
# Provide a "standardized" way to retrieve the CLI args that will
|
223
|
+
# work with both Windows and non-Windows executions.
|
224
|
+
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
225
|
+
export MAVEN_CMD_LINE_ARGS
|
226
|
+
|
227
|
+
exec "$JAVACMD" \
|
228
|
+
$MAVEN_OPTS \
|
229
|
+
-classpath "${M2_HOME}"/boot/plexus-classworlds-*.jar \
|
230
|
+
"-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
|
231
|
+
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
232
|
+
${CLASSWORLDS_LAUNCHER} "$@"
|
@@ -0,0 +1,176 @@
|
|
1
|
+
@REM ----------------------------------------------------------------------------
|
2
|
+
@REM Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
@REM or more contributor license agreements. See the NOTICE file
|
4
|
+
@REM distributed with this work for additional information
|
5
|
+
@REM regarding copyright ownership. The ASF licenses this file
|
6
|
+
@REM to you under the Apache License, Version 2.0 (the
|
7
|
+
@REM "License"); you may not use this file except in compliance
|
8
|
+
@REM with the License. You may obtain a copy of the License at
|
9
|
+
@REM
|
10
|
+
@REM http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
@REM
|
12
|
+
@REM Unless required by applicable law or agreed to in writing,
|
13
|
+
@REM software distributed under the License is distributed on an
|
14
|
+
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
@REM KIND, either express or implied. See the License for the
|
16
|
+
@REM specific language governing permissions and limitations
|
17
|
+
@REM under the License.
|
18
|
+
@REM ----------------------------------------------------------------------------
|
19
|
+
|
20
|
+
@REM ----------------------------------------------------------------------------
|
21
|
+
@REM Maven2 Start Up Batch script
|
22
|
+
@REM
|
23
|
+
@REM Required ENV vars:
|
24
|
+
@REM JAVA_HOME - location of a JDK home dir
|
25
|
+
@REM
|
26
|
+
@REM Optional ENV vars
|
27
|
+
@REM M2_HOME - location of maven2's installed home dir
|
28
|
+
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
29
|
+
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
|
30
|
+
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
31
|
+
@REM e.g. to debug Maven itself, use
|
32
|
+
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
33
|
+
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
34
|
+
@REM ----------------------------------------------------------------------------
|
35
|
+
|
36
|
+
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
37
|
+
@echo off
|
38
|
+
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
|
39
|
+
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
40
|
+
|
41
|
+
@REM set %HOME% to equivalent of $HOME
|
42
|
+
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
43
|
+
|
44
|
+
@REM Execute a user defined script before this one
|
45
|
+
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
46
|
+
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
47
|
+
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
48
|
+
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
49
|
+
:skipRcPre
|
50
|
+
|
51
|
+
@setlocal
|
52
|
+
|
53
|
+
set ERROR_CODE=0
|
54
|
+
|
55
|
+
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
56
|
+
@setlocal
|
57
|
+
|
58
|
+
@REM ==== START VALIDATION ====
|
59
|
+
if not "%JAVA_HOME%" == "" goto OkJHome
|
60
|
+
|
61
|
+
echo.
|
62
|
+
echo Error: JAVA_HOME not found in your environment. >&2
|
63
|
+
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
64
|
+
echo location of your Java installation. >&2
|
65
|
+
echo.
|
66
|
+
goto error
|
67
|
+
|
68
|
+
:OkJHome
|
69
|
+
if exist "%JAVA_HOME%\bin\java.exe" goto chkMHome
|
70
|
+
|
71
|
+
echo.
|
72
|
+
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
73
|
+
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
74
|
+
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
75
|
+
echo location of your Java installation. >&2
|
76
|
+
echo.
|
77
|
+
goto error
|
78
|
+
|
79
|
+
:chkMHome
|
80
|
+
if not "%M2_HOME%"=="" goto valMHome
|
81
|
+
|
82
|
+
SET "M2_HOME=%~dp0.."
|
83
|
+
if not "%M2_HOME%"=="" goto valMHome
|
84
|
+
|
85
|
+
echo.
|
86
|
+
echo Error: M2_HOME not found in your environment. >&2
|
87
|
+
echo Please set the M2_HOME variable in your environment to match the >&2
|
88
|
+
echo location of the Maven installation. >&2
|
89
|
+
echo.
|
90
|
+
goto error
|
91
|
+
|
92
|
+
:valMHome
|
93
|
+
|
94
|
+
:stripMHome
|
95
|
+
if not "_%M2_HOME:~-1%"=="_\" goto checkMCmd
|
96
|
+
set "M2_HOME=%M2_HOME:~0,-1%"
|
97
|
+
goto stripMHome
|
98
|
+
|
99
|
+
:checkMCmd
|
100
|
+
if exist "%M2_HOME%\bin\mvn.cmd" goto init
|
101
|
+
|
102
|
+
echo.
|
103
|
+
echo Error: M2_HOME is set to an invalid directory. >&2
|
104
|
+
echo M2_HOME = "%M2_HOME%" >&2
|
105
|
+
echo Please set the M2_HOME variable in your environment to match the >&2
|
106
|
+
echo location of the Maven installation >&2
|
107
|
+
echo.
|
108
|
+
goto error
|
109
|
+
@REM ==== END VALIDATION ====
|
110
|
+
|
111
|
+
:init
|
112
|
+
|
113
|
+
set MAVEN_CMD_LINE_ARGS=%*
|
114
|
+
|
115
|
+
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
116
|
+
@REM Fallback to current working directory if not found.
|
117
|
+
|
118
|
+
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
119
|
+
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
120
|
+
|
121
|
+
set EXEC_DIR=%CD%
|
122
|
+
set WDIR=%EXEC_DIR%
|
123
|
+
:findBaseDir
|
124
|
+
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
125
|
+
cd ..
|
126
|
+
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
127
|
+
set WDIR=%CD%
|
128
|
+
goto findBaseDir
|
129
|
+
|
130
|
+
:baseDirFound
|
131
|
+
set MAVEN_PROJECTBASEDIR=%WDIR%
|
132
|
+
cd "%EXEC_DIR%"
|
133
|
+
goto endDetectBaseDir
|
134
|
+
|
135
|
+
:baseDirNotFound
|
136
|
+
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
137
|
+
cd "%EXEC_DIR%"
|
138
|
+
|
139
|
+
:endDetectBaseDir
|
140
|
+
|
141
|
+
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
142
|
+
|
143
|
+
@setlocal EnableExtensions EnableDelayedExpansion
|
144
|
+
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
145
|
+
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
146
|
+
|
147
|
+
:endReadAdditionalConfig
|
148
|
+
|
149
|
+
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
150
|
+
|
151
|
+
for %%i in ("%M2_HOME%"\boot\plexus-classworlds-*) do set CLASSWORLDS_JAR="%%i"
|
152
|
+
|
153
|
+
set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
154
|
+
|
155
|
+
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
|
156
|
+
if ERRORLEVEL 1 goto error
|
157
|
+
goto end
|
158
|
+
|
159
|
+
:error
|
160
|
+
set ERROR_CODE=1
|
161
|
+
|
162
|
+
:end
|
163
|
+
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
164
|
+
|
165
|
+
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
166
|
+
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
167
|
+
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
168
|
+
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
169
|
+
:skipRcPost
|
170
|
+
|
171
|
+
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
172
|
+
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
173
|
+
|
174
|
+
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
175
|
+
|
176
|
+
exit /B %ERROR_CODE%
|
@@ -0,0 +1,41 @@
|
|
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
|
+
# http://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
|
+
# Maven2 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
|
+
MAVEN_DEBUG_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
|
38
|
+
|
39
|
+
echo Preparing to Execute Maven in Debug Mode
|
40
|
+
|
41
|
+
env MAVEN_OPTS="$MAVEN_OPTS $MAVEN_DEBUG_OPTS" $(dirname $0)/mvn "$@"
|