Skip to content

Commit 543f60a

Browse files
committed
Update Maven to 3.8.5
1 parent cc7c500 commit 543f60a

File tree

4 files changed

+169
-18
lines changed

4 files changed

+169
-18
lines changed

.mvn/wrapper/maven-wrapper.jar

100755100644
10.7 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.1.1/apache-maven-3.1.1-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+
# http://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.5/apache-maven-3.8.5-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

mvnw

Lines changed: 93 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# ----------------------------------------------------------------------------
2020

2121
# ----------------------------------------------------------------------------
22-
# Maven2 Start Up Batch script
22+
# Maven Start Up Batch script
2323
#
2424
# Required ENV vars:
2525
# ------------------
@@ -36,6 +36,10 @@
3636

3737
if [ -z "$MAVEN_SKIP_RC" ] ; then
3838

39+
if [ -f /usr/local/etc/mavenrc ] ; then
40+
. /usr/local/etc/mavenrc
41+
fi
42+
3943
if [ -f /etc/mavenrc ] ; then
4044
. /etc/mavenrc
4145
fi
@@ -114,7 +118,6 @@ if $mingw ; then
114118
M2_HOME="`(cd "$M2_HOME"; pwd)`"
115119
[ -n "$JAVA_HOME" ] &&
116120
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117-
# TODO classpath?
118121
fi
119122

120123
if [ -z "$JAVA_HOME" ]; then
@@ -146,7 +149,7 @@ if [ -z "$JAVACMD" ] ; then
146149
JAVACMD="$JAVA_HOME/bin/java"
147150
fi
148151
else
149-
JAVACMD="`which java`"
152+
JAVACMD="`\\unset -f command; \\command -v java`"
150153
fi
151154
fi
152155

@@ -200,6 +203,85 @@ if [ -z "$BASE_DIR" ]; then
200203
exit 1;
201204
fi
202205

206+
##########################################################################################
207+
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
208+
# This allows using the maven wrapper in projects that prohibit checking in binary data.
209+
##########################################################################################
210+
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
211+
if [ "$MVNW_VERBOSE" = true ]; then
212+
echo "Found .mvn/wrapper/maven-wrapper.jar"
213+
fi
214+
else
215+
if [ "$MVNW_VERBOSE" = true ]; then
216+
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
217+
fi
218+
if [ -n "$MVNW_REPOURL" ]; then
219+
jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
220+
else
221+
jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
222+
fi
223+
while IFS="=" read key value; do
224+
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
225+
esac
226+
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
227+
if [ "$MVNW_VERBOSE" = true ]; then
228+
echo "Downloading from: $jarUrl"
229+
fi
230+
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
231+
if $cygwin; then
232+
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
233+
fi
234+
235+
if command -v wget > /dev/null; then
236+
if [ "$MVNW_VERBOSE" = true ]; then
237+
echo "Found wget ... using wget"
238+
fi
239+
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
240+
wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
241+
else
242+
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
243+
fi
244+
elif command -v curl > /dev/null; then
245+
if [ "$MVNW_VERBOSE" = true ]; then
246+
echo "Found curl ... using curl"
247+
fi
248+
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
249+
curl -o "$wrapperJarPath" "$jarUrl" -f
250+
else
251+
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
252+
fi
253+
254+
else
255+
if [ "$MVNW_VERBOSE" = true ]; then
256+
echo "Falling back to using Java to download"
257+
fi
258+
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
259+
# For Cygwin, switch paths to Windows format before running javac
260+
if $cygwin; then
261+
javaClass=`cygpath --path --windows "$javaClass"`
262+
fi
263+
if [ -e "$javaClass" ]; then
264+
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
265+
if [ "$MVNW_VERBOSE" = true ]; then
266+
echo " - Compiling MavenWrapperDownloader.java ..."
267+
fi
268+
# Compiling the Java class
269+
("$JAVA_HOME/bin/javac" "$javaClass")
270+
fi
271+
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
272+
# Running the downloader
273+
if [ "$MVNW_VERBOSE" = true ]; then
274+
echo " - Running MavenWrapperDownloader.java ..."
275+
fi
276+
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
277+
fi
278+
fi
279+
fi
280+
fi
281+
##########################################################################################
282+
# End of extension
283+
##########################################################################################
284+
203285
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
204286
if [ "$MVNW_VERBOSE" = true ]; then
205287
echo $MAVEN_PROJECTBASEDIR
@@ -218,10 +300,17 @@ if $cygwin; then
218300
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
219301
fi
220302

303+
# Provide a "standardized" way to retrieve the CLI args that will
304+
# work with both Windows and non-Windows executions.
305+
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
306+
export MAVEN_CMD_LINE_ARGS
307+
221308
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
222309

223310
exec "$JAVACMD" \
224311
$MAVEN_OPTS \
312+
$MAVEN_DEBUG_OPTS \
225313
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
226-
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
314+
"-Dmaven.home=${M2_HOME}" \
315+
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
227316
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

mvnw.cmd

100755100644
Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
@REM ----------------------------------------------------------------------------
1919

2020
@REM ----------------------------------------------------------------------------
21-
@REM Maven2 Start Up Batch script
21+
@REM Maven Start Up Batch script
2222
@REM
2323
@REM Required ENV vars:
2424
@REM JAVA_HOME - location of a JDK home dir
2525
@REM
2626
@REM Optional ENV vars
2727
@REM M2_HOME - location of maven2's installed home dir
2828
@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
29+
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
3030
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
3131
@REM e.g. to debug Maven itself, use
3232
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@@ -35,7 +35,9 @@
3535

3636
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
3737
@echo off
38-
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
38+
@REM set title of command window
39+
title %0
40+
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
3941
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
4042

4143
@REM set %HOME% to equivalent of $HOME
@@ -44,8 +46,8 @@ if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
4446
@REM Execute a user defined script before this one
4547
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
4648
@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+
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
50+
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
4951
:skipRcPre
5052

5153
@setlocal
@@ -115,11 +117,54 @@ for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do s
115117
:endReadAdditionalConfig
116118

117119
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
118-
119120
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
120121
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
121122

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

@@ -129,15 +174,15 @@ set ERROR_CODE=1
129174
:end
130175
@endlocal & set ERROR_CODE=%ERROR_CODE%
131176

132-
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
177+
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
133178
@REM check for post script, once with legacy .bat ending and once with .cmd ending
134-
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
135-
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
179+
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
180+
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
136181
:skipRcPost
137182

138183
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
139-
if "%MAVEN_BATCH_PAUSE%" == "on" pause
184+
if "%MAVEN_BATCH_PAUSE%"=="on" pause
140185

141-
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
186+
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
142187

143-
exit /B %ERROR_CODE%
188+
cmd /C exit /B %ERROR_CODE%

0 commit comments

Comments
 (0)