Skip to content

Commit 60ba8f9

Browse files
committed
update maven wrapper to 3.8.4/3.1.1
1 parent a862792 commit 60ba8f9

File tree

4 files changed

+179
-60
lines changed

4 files changed

+179
-60
lines changed

Diff for: .mvn/wrapper/maven-wrapper.jar

100755100644
11.3 KB
Binary file not shown.

Diff for: .mvn/wrapper/maven-wrapper.properties

+18-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-bin.zip
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar

Diff for: mvnw

+105-45
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@
1919
# ----------------------------------------------------------------------------
2020

2121
# ----------------------------------------------------------------------------
22-
# Maven2 Start Up Batch script
22+
# Apache Maven Wrapper startup batch script, version 3.1.1
2323
#
2424
# Required ENV vars:
2525
# ------------------
2626
# JAVA_HOME - location of a JDK home dir
2727
#
2828
# Optional ENV vars
2929
# -----------------
30-
# M2_HOME - location of maven2's installed home dir
3130
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
3231
# e.g. to debug Maven itself, use
3332
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@@ -36,6 +35,10 @@
3635

3736
if [ -z "$MAVEN_SKIP_RC" ] ; then
3837

38+
if [ -f /usr/local/etc/mavenrc ] ; then
39+
. /usr/local/etc/mavenrc
40+
fi
41+
3942
if [ -f /etc/mavenrc ] ; then
4043
. /etc/mavenrc
4144
fi
@@ -58,9 +61,9 @@ case "`uname`" in
5861
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
5962
if [ -z "$JAVA_HOME" ]; then
6063
if [ -x "/usr/libexec/java_home" ]; then
61-
export JAVA_HOME="`/usr/libexec/java_home`"
64+
JAVA_HOME="`/usr/libexec/java_home`"; export JAVA_HOME
6265
else
63-
export JAVA_HOME="/Library/Java/Home"
66+
JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
6467
fi
6568
fi
6669
;;
@@ -72,36 +75,8 @@ if [ -z "$JAVA_HOME" ] ; then
7275
fi
7376
fi
7477

75-
if [ -z "$M2_HOME" ] ; then
76-
## resolve links - $0 may be a link to maven's home
77-
PRG="$0"
78-
79-
# need this for relative symlinks
80-
while [ -h "$PRG" ] ; do
81-
ls=`ls -ld "$PRG"`
82-
link=`expr "$ls" : '.*-> \(.*\)$'`
83-
if expr "$link" : '/.*' > /dev/null; then
84-
PRG="$link"
85-
else
86-
PRG="`dirname "$PRG"`/$link"
87-
fi
88-
done
89-
90-
saveddir=`pwd`
91-
92-
M2_HOME=`dirname "$PRG"`/..
93-
94-
# make it fully qualified
95-
M2_HOME=`cd "$M2_HOME" && pwd`
96-
97-
cd "$saveddir"
98-
# echo Using m2 at $M2_HOME
99-
fi
100-
10178
# For Cygwin, ensure paths are in UNIX format before anything is touched
10279
if $cygwin ; then
103-
[ -n "$M2_HOME" ] &&
104-
M2_HOME=`cygpath --unix "$M2_HOME"`
10580
[ -n "$JAVA_HOME" ] &&
10681
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
10782
[ -n "$CLASSPATH" ] &&
@@ -110,11 +85,8 @@ fi
11085

11186
# For Mingw, ensure paths are in UNIX format before anything is touched
11287
if $mingw ; then
113-
[ -n "$M2_HOME" ] &&
114-
M2_HOME="`(cd "$M2_HOME"; pwd)`"
11588
[ -n "$JAVA_HOME" ] &&
11689
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117-
# TODO classpath?
11890
fi
11991

12092
if [ -z "$JAVA_HOME" ]; then
@@ -146,7 +118,7 @@ if [ -z "$JAVACMD" ] ; then
146118
JAVACMD="$JAVA_HOME/bin/java"
147119
fi
148120
else
149-
JAVACMD="`which java`"
121+
JAVACMD="`\\unset -f command; \\command -v java`"
150122
fi
151123
fi
152124

@@ -160,12 +132,9 @@ if [ -z "$JAVA_HOME" ] ; then
160132
echo "Warning: JAVA_HOME environment variable is not set."
161133
fi
162134

163-
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
164-
165135
# traverses directory structure from process work directory to filesystem root
166136
# first directory with .mvn subdirectory is considered project base directory
167137
find_maven_basedir() {
168-
169138
if [ -z "$1" ]
170139
then
171140
echo "Path not specified to find_maven_basedir"
@@ -185,7 +154,7 @@ find_maven_basedir() {
185154
fi
186155
# end of workaround
187156
done
188-
echo "${basedir}"
157+
printf '%s' "$(cd "$basedir"; pwd)"
189158
}
190159

191160
# concatenates all lines of a file
@@ -195,21 +164,106 @@ concat_lines() {
195164
fi
196165
}
197166

198-
BASE_DIR=`find_maven_basedir "$(pwd)"`
167+
BASE_DIR=$(find_maven_basedir "$(dirname $0)")
199168
if [ -z "$BASE_DIR" ]; then
200169
exit 1;
201170
fi
202171

203-
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
172+
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
204173
if [ "$MVNW_VERBOSE" = true ]; then
205174
echo $MAVEN_PROJECTBASEDIR
206175
fi
176+
177+
##########################################################################################
178+
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
179+
# This allows using the maven wrapper in projects that prohibit checking in binary data.
180+
##########################################################################################
181+
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
182+
if [ "$MVNW_VERBOSE" = true ]; then
183+
echo "Found .mvn/wrapper/maven-wrapper.jar"
184+
fi
185+
else
186+
if [ "$MVNW_VERBOSE" = true ]; then
187+
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
188+
fi
189+
if [ -n "$MVNW_REPOURL" ]; then
190+
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar"
191+
else
192+
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar"
193+
fi
194+
while IFS="=" read key value; do
195+
case "$key" in (wrapperUrl) wrapperUrl="$value"; break ;;
196+
esac
197+
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
198+
if [ "$MVNW_VERBOSE" = true ]; then
199+
echo "Downloading from: $wrapperUrl"
200+
fi
201+
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
202+
if $cygwin; then
203+
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
204+
fi
205+
206+
if command -v wget > /dev/null; then
207+
QUIET="--quiet"
208+
if [ "$MVNW_VERBOSE" = true ]; then
209+
echo "Found wget ... using wget"
210+
QUIET=""
211+
fi
212+
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
213+
wget $QUIET "$wrapperUrl" -O "$wrapperJarPath"
214+
else
215+
wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath"
216+
fi
217+
[ $? -eq 0 ] || rm -f "$wrapperJarPath"
218+
elif command -v curl > /dev/null; then
219+
QUIET="--silent"
220+
if [ "$MVNW_VERBOSE" = true ]; then
221+
echo "Found curl ... using curl"
222+
QUIET=""
223+
fi
224+
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
225+
curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L
226+
else
227+
curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L
228+
fi
229+
[ $? -eq 0 ] || rm -f "$wrapperJarPath"
230+
else
231+
if [ "$MVNW_VERBOSE" = true ]; then
232+
echo "Falling back to using Java to download"
233+
fi
234+
javaSource="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
235+
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class"
236+
# For Cygwin, switch paths to Windows format before running javac
237+
if $cygwin; then
238+
javaSource=`cygpath --path --windows "$javaSource"`
239+
javaClass=`cygpath --path --windows "$javaClass"`
240+
fi
241+
if [ -e "$javaSource" ]; then
242+
if [ ! -e "$javaClass" ]; then
243+
if [ "$MVNW_VERBOSE" = true ]; then
244+
echo " - Compiling MavenWrapperDownloader.java ..."
245+
fi
246+
# Compiling the Java class
247+
("$JAVA_HOME/bin/javac" "$javaSource")
248+
fi
249+
if [ -e "$javaClass" ]; then
250+
# Running the downloader
251+
if [ "$MVNW_VERBOSE" = true ]; then
252+
echo " - Running MavenWrapperDownloader.java ..."
253+
fi
254+
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
255+
fi
256+
fi
257+
fi
258+
fi
259+
##########################################################################################
260+
# End of extension
261+
##########################################################################################
262+
207263
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
208264

209265
# For Cygwin, switch paths to Windows format before running java
210266
if $cygwin; then
211-
[ -n "$M2_HOME" ] &&
212-
M2_HOME=`cygpath --path --windows "$M2_HOME"`
213267
[ -n "$JAVA_HOME" ] &&
214268
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
215269
[ -n "$CLASSPATH" ] &&
@@ -218,10 +272,16 @@ if $cygwin; then
218272
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
219273
fi
220274

275+
# Provide a "standardized" way to retrieve the CLI args that will
276+
# work with both Windows and non-Windows executions.
277+
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
278+
export MAVEN_CMD_LINE_ARGS
279+
221280
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
222281

223282
exec "$JAVACMD" \
224283
$MAVEN_OPTS \
284+
$MAVEN_DEBUG_OPTS \
225285
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
226-
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
286+
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
227287
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

Diff for: mvnw.cmd

100755100644
+56-14
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@
1818
@REM ----------------------------------------------------------------------------
1919

2020
@REM ----------------------------------------------------------------------------
21-
@REM Maven2 Start Up Batch script
21+
@REM Apache Maven Wrapper startup batch script, version 3.1.1
2222
@REM
2323
@REM Required ENV vars:
2424
@REM JAVA_HOME - location of a JDK home dir
2525
@REM
2626
@REM Optional ENV vars
27-
@REM M2_HOME - location of maven2's installed home dir
2827
@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
28+
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
3029
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
3130
@REM e.g. to debug Maven itself, use
3231
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@@ -37,7 +36,7 @@
3736
@echo off
3837
@REM set title of command window
3938
title %0
40-
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
39+
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
4140
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
4241

4342
@REM set %HOME% to equivalent of $HOME
@@ -46,8 +45,8 @@ if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
4645
@REM Execute a user defined script before this one
4746
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
4847
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
49-
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50-
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
48+
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
49+
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
5150
:skipRcPre
5251

5352
@setlocal
@@ -117,11 +116,54 @@ for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do s
117116
:endReadAdditionalConfig
118117

119118
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120-
121119
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
122120
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
123121

124-
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
122+
set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar"
123+
124+
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
125+
IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B
126+
)
127+
128+
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
129+
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
130+
if exist %WRAPPER_JAR% (
131+
if "%MVNW_VERBOSE%" == "true" (
132+
echo Found %WRAPPER_JAR%
133+
)
134+
) else (
135+
if not "%MVNW_REPOURL%" == "" (
136+
SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar"
137+
)
138+
if "%MVNW_VERBOSE%" == "true" (
139+
echo Couldn't find %WRAPPER_JAR%, downloading it ...
140+
echo Downloading from: %WRAPPER_URL%
141+
)
142+
143+
powershell -Command "&{"^
144+
"$webclient = new-object System.Net.WebClient;"^
145+
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
146+
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
147+
"}"^
148+
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
149+
"}"
150+
if "%MVNW_VERBOSE%" == "true" (
151+
echo Finished downloading %WRAPPER_JAR%
152+
)
153+
)
154+
@REM End of extension
155+
156+
@REM Provide a "standardized" way to retrieve the CLI args that will
157+
@REM work with both Windows and non-Windows executions.
158+
set MAVEN_CMD_LINE_ARGS=%*
159+
160+
%MAVEN_JAVA_EXE% ^
161+
%JVM_CONFIG_MAVEN_PROPS% ^
162+
%MAVEN_OPTS% ^
163+
%MAVEN_DEBUG_OPTS% ^
164+
-classpath %WRAPPER_JAR% ^
165+
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
166+
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
125167
if ERRORLEVEL 1 goto error
126168
goto end
127169

@@ -131,15 +173,15 @@ set ERROR_CODE=1
131173
:end
132174
@endlocal & set ERROR_CODE=%ERROR_CODE%
133175

134-
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
176+
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
135177
@REM check for post script, once with legacy .bat ending and once with .cmd ending
136-
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
137-
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
178+
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
179+
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
138180
:skipRcPost
139181

140182
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
141-
if "%MAVEN_BATCH_PAUSE%" == "on" pause
183+
if "%MAVEN_BATCH_PAUSE%"=="on" pause
142184

143-
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
185+
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
144186

145-
exit /B %ERROR_CODE%
187+
cmd /C exit /B %ERROR_CODE%

0 commit comments

Comments
 (0)