Skip to content

Commit 7c5b531

Browse files
committed
deps: Update dependency maven-wrapper to v3.3.2
1 parent 4b22fb9 commit 7c5b531

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

.mvn/wrapper/maven-wrapper.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
wrapperVersion=3.3.1
17+
wrapperVersion=3.3.2
18+
distributionType=only-script
1819
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip

mvnw

+13-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# ----------------------------------------------------------------------------
2020

2121
# ----------------------------------------------------------------------------
22-
# Apache Maven Wrapper startup batch script, version 3.3.1
22+
# Apache Maven Wrapper startup batch script, version 3.3.2
2323
#
2424
# Optional ENV vars
2525
# -----------------
@@ -97,11 +97,19 @@ die() {
9797
exit 1
9898
}
9999

100+
trim() {
101+
# MWRAPPER-139:
102+
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
103+
# Needed for removing poorly interpreted newline sequences when running in more
104+
# exotic environments such as mingw bash on Windows.
105+
printf "%s" "${1}" | tr -d '[:space:]'
106+
}
107+
100108
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
101109
while IFS="=" read -r key value; do
102110
case "${key-}" in
103-
distributionUrl) distributionUrl="${value-}" ;;
104-
distributionSha256Sum) distributionSha256Sum="${value-}" ;;
111+
distributionUrl) distributionUrl=$(trim "${value-}") ;;
112+
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
105113
esac
106114
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
107115
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
@@ -131,7 +139,8 @@ esac
131139
distributionUrlName="${distributionUrl##*/}"
132140
distributionUrlNameMain="${distributionUrlName%.*}"
133141
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
134-
MAVEN_HOME="$HOME/.m2/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
142+
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
143+
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
135144

136145
exec_maven() {
137146
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :

mvnw.cmd

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@REM ----------------------------------------------------------------------------
2020

2121
@REM ----------------------------------------------------------------------------
22-
@REM Apache Maven Wrapper startup batch script, version 3.3.1
22+
@REM Apache Maven Wrapper startup batch script, version 3.3.2
2323
@REM
2424
@REM Optional ENV vars
2525
@REM MVNW_REPOURL - repo url base for downloading maven distribution
@@ -79,6 +79,9 @@ if ($env:MVNW_REPOURL) {
7979
$distributionUrlName = $distributionUrl -replace '^.*/',''
8080
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
8181
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
82+
if ($env:MAVEN_USER_HOME) {
83+
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
84+
}
8285
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
8386
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
8487

0 commit comments

Comments
 (0)