Skip to content

Commit 5016ab6

Browse files
committed
Update maven wrapper
1 parent 37ec7d2 commit 5016ab6

File tree

5 files changed

+40
-48
lines changed

5 files changed

+40
-48
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# All text files should have the "lf" (Unix) line endings
22
* text eol=lf
3+
# windows cmd shoud have the "crlf" (Win32) line endings
4+
*.cmd eol=crlf
35

46
# Explicitly declare text files you want to always be normalized and converted
57
# to native line endings on checkout.

.mvn/wrapper/maven-wrapper.jar

100644100755
-1.16 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
1+
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip

mvnw

+34-43
Original file line numberDiff line numberDiff line change
@@ -54,38 +54,16 @@ case "`uname`" in
5454
CYGWIN*) cygwin=true ;;
5555
MINGW*) mingw=true;;
5656
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-
;;
57+
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
58+
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
59+
if [ -z "$JAVA_HOME" ]; then
60+
if [ -x "/usr/libexec/java_home" ]; then
61+
export JAVA_HOME="`/usr/libexec/java_home`"
62+
else
63+
export JAVA_HOME="/Library/Java/Home"
64+
fi
65+
fi
66+
;;
8967
esac
9068

9169
if [ -z "$JAVA_HOME" ] ; then
@@ -130,7 +108,7 @@ if $cygwin ; then
130108
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
131109
fi
132110

133-
# For Migwn, ensure paths are in UNIX format before anything is touched
111+
# For Mingw, ensure paths are in UNIX format before anything is touched
134112
if $mingw ; then
135113
[ -n "$M2_HOME" ] &&
136114
M2_HOME="`(cd "$M2_HOME"; pwd)`"
@@ -187,14 +165,25 @@ CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
187165
# traverses directory structure from process work directory to filesystem root
188166
# first directory with .mvn subdirectory is considered project base directory
189167
find_maven_basedir() {
190-
local basedir=$(pwd)
191-
local wdir=$(pwd)
168+
169+
if [ -z "$1" ]
170+
then
171+
echo "Path not specified to find_maven_basedir"
172+
return 1
173+
fi
174+
175+
basedir="$1"
176+
wdir="$1"
192177
while [ "$wdir" != '/' ] ; do
193178
if [ -d "$wdir"/.mvn ] ; then
194179
basedir=$wdir
195180
break
196181
fi
197-
wdir=$(cd "$wdir/.."; pwd)
182+
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
183+
if [ -d "${wdir}" ]; then
184+
wdir=`cd "$wdir/.."; pwd`
185+
fi
186+
# end of workaround
198187
done
199188
echo "${basedir}"
200189
}
@@ -206,7 +195,15 @@ concat_lines() {
206195
fi
207196
}
208197

209-
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
198+
BASE_DIR=`find_maven_basedir "$(pwd)"`
199+
if [ -z "$BASE_DIR" ]; then
200+
exit 1;
201+
fi
202+
203+
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
204+
if [ "$MVNW_VERBOSE" = true ]; then
205+
echo $MAVEN_PROJECTBASEDIR
206+
fi
210207
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
211208

212209
# For Cygwin, switch paths to Windows format before running java
@@ -221,14 +218,8 @@ if $cygwin; then
221218
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
222219
fi
223220

224-
# Provide a "standardized" way to retrieve the CLI args that will
225-
# work with both Windows and non-Windows executions.
226-
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
227-
export MAVEN_CMD_LINE_ARGS
228-
229221
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
230222

231-
# avoid using MAVEN_CMD_LINE_ARGS below since that would loose parameter escaping in $@
232223
exec "$JAVACMD" \
233224
$MAVEN_OPTS \
234225
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \

mvnw.cmd

100644100755
+3-4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

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

@@ -80,8 +82,6 @@ goto error
8082

8183
:init
8284

83-
set MAVEN_CMD_LINE_ARGS=%MAVEN_CONFIG% %*
84-
8585
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
8686
@REM Fallback to current working directory if not found.
8787

@@ -118,10 +118,9 @@ for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do s
118118

119119
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120120

121-
set WRAPPER_JAR=""%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar""
121+
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
122122
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
123123

124-
# avoid using MAVEN_CMD_LINE_ARGS below since that would loose parameter escaping in %*
125124
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
126125
if ERRORLEVEL 1 goto error
127126
goto end

0 commit comments

Comments
 (0)