File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
maven-wrapper-distribution/src/resources Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -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"
You can’t perform that action at this time.
0 commit comments