|
19 | 19 | # ----------------------------------------------------------------------------
|
20 | 20 |
|
21 | 21 | # ----------------------------------------------------------------------------
|
22 |
| -# Apache Maven Wrapper startup batch script, version 3.3.1 |
| 22 | +# Apache Maven Wrapper startup batch script, version 3.3.2 |
23 | 23 | #
|
24 | 24 | # Optional ENV vars
|
25 | 25 | # -----------------
|
@@ -97,11 +97,19 @@ die() {
|
97 | 97 | exit 1
|
98 | 98 | }
|
99 | 99 |
|
| 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 | + |
100 | 108 | # parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
|
101 | 109 | while IFS="=" read -r key value; do
|
102 | 110 | case "${key-}" in
|
103 |
| - distributionUrl) distributionUrl="${value-}" ;; |
104 |
| - distributionSha256Sum) distributionSha256Sum="${value-}" ;; |
| 111 | + distributionUrl) distributionUrl=$(trim "${value-}") ;; |
| 112 | + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; |
105 | 113 | esac
|
106 | 114 | done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
107 | 115 | [ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
|
131 | 139 | distributionUrlName="${distributionUrl##*/}"
|
132 | 140 | distributionUrlNameMain="${distributionUrlName%.*}"
|
133 | 141 | 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")" |
135 | 144 |
|
136 | 145 | exec_maven() {
|
137 | 146 | unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
|
|
0 commit comments