Skip to content

Commit 0292905

Browse files
authored
Upgrade maven-wrapper to 3.8.6 for performance improvements and ARM more native support (#7003)
1 parent eab3a18 commit 0292905

File tree

10 files changed

+148
-171
lines changed

10 files changed

+148
-171
lines changed

.github/workflows/e2e.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
restore-keys: ${{ runner.os }}-m2
4343

4444
- name: Build Distribution Zip
45-
run: ./mvnw.sh -B -DskipTests clean install
45+
run: ./mvnw -B -DskipTests clean install
4646

4747
- name: Build Docker Image
4848
run: |

.mvn/wrapper/MavenWrapperDownloader.java

-115
This file was deleted.

.mvn/wrapper/maven-wrapper.properties

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1-
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2-
#wrapperUrl=https://repo1.maven.org/maven2/io/takari/maven-wrapper/0.2.1/maven-wrapper-0.2.1.jar
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+
18+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
19+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
The following class is copied from maven-wrapper (https://github.com/takari/maven-wrapper),
208208
which is under Apache License 2.0:
209209

210-
./.mvn/wrapper/MavenWrapperDownloader.java
210+
mvnw files from https://github.com/apache/maven-wrapper Apache 2.0
211211

212212
--------------------------------------------------------------------------------
213213

docs/Development/VoteRelease.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Compared with the corresponding .sha512, the same is fine.
100100
* Verify compilation
101101

102102
```
103-
mvnw.sh install
103+
mvnw install
104104
105105
Should end up all SUCCESS
106106
```
@@ -161,7 +161,7 @@ The source release:
161161
LICENSE and NOTICE [ok]
162162
signatures and hashes [ok]
163163
All files have ASF header [ok]
164-
could compile from source: ./mvnw.sh clean install [ok]
164+
could compile from source: ./mvnw clean install [ok]
165165
166166
The binary distribution:
167167
LICENSE and NOTICE [ok]

docs/UserGuide/QuickStart/WayToGetIoTDB.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ To use IoTDB, you need to have:
3535
2. Maven >= 3.6 (Optional)
3636
3. Set the max open files num as 65535 to avoid "too many open files" problem.
3737

38-
>Note: If you don't have maven installed, you should replace 'mvn' in the following commands with 'mvnw.sh' or 'mvnw.cmd'.
38+
>Note: If you don't have maven installed, you should replace 'mvn' in the following commands with 'mvnw' or 'mvnw.cmd'.
3939
>
4040
>### Installation from binary files
4141

docs/zh/Development/VoteRelease.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ shasum -a512 apache-iotdb-0.12.0-source-release.zip
100100
* 验证编译
101101

102102
```
103-
mvnw.sh install
103+
mvnw install
104104
105105
应该最后全 SUCCESS
106106
```
@@ -161,7 +161,7 @@ The source release:
161161
LICENSE and NOTICE [ok]
162162
signatures and hashes [ok]
163163
All files have ASF header [ok]
164-
could compile from source: ./mvnw.sh clean install [ok]
164+
could compile from source: ./mvnw clean install [ok]
165165
166166
The binary distribution:
167167
LICENSE and NOTICE [ok]

docs/zh/UserGuide/QuickStart/WayToGetIoTDB.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ IoTDB 为您提供了两种安装方式,您可以参考下面的建议,任
3535

3636
1. Maven >= 3.6 的运行环境,具体安装方法可以参考以下链接:[https://maven.apache.org/install.html](https://maven.apache.org/install.html)
3737

38-
> 注: 也可以选择不安装,使用我们提供的'mvnw.sh' 或 'mvnw.cmd' 工具。使用时请用'mvnw.sh' 或 'mvnw.cmd'命令代替下文的'mvn'命令。
38+
> 注: 也可以选择不安装,使用我们提供的'mvnw' 或 'mvnw.cmd' 工具。使用时请用'mvnw' 或 'mvnw.cmd'命令代替下文的'mvn'命令。
3939
4040
### 从官网下载二进制可执行文件
4141

mvnw.sh renamed to mvnw

+69-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/sh
2-
#
3-
#
2+
# ----------------------------------------------------------------------------
43
# Licensed to the Apache Software Foundation (ASF) under one
54
# or more contributor license agreements. See the NOTICE file
65
# distributed with this work for additional information
@@ -9,19 +8,18 @@
98
# "License"); you may not use this file except in compliance
109
# with the License. You may obtain a copy of the License at
1110
#
12-
# http://www.apache.org/licenses/LICENSE-2.0
11+
# http://www.apache.org/licenses/LICENSE-2.0
1312
#
1413
# Unless required by applicable law or agreed to in writing,
1514
# software distributed under the License is distributed on an
1615
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1716
# KIND, either express or implied. See the License for the
1817
# specific language governing permissions and limitations
1918
# under the License.
20-
#
21-
19+
# ----------------------------------------------------------------------------
2220

2321
# ----------------------------------------------------------------------------
24-
# Maven2 Start Up Batch script
22+
# Maven Start Up Batch script
2523
#
2624
# Required ENV vars:
2725
# ------------------
@@ -38,6 +36,10 @@
3836

3937
if [ -z "$MAVEN_SKIP_RC" ] ; then
4038

39+
if [ -f /usr/local/etc/mavenrc ] ; then
40+
. /usr/local/etc/mavenrc
41+
fi
42+
4143
if [ -f /etc/mavenrc ] ; then
4244
. /etc/mavenrc
4345
fi
@@ -116,7 +118,6 @@ if $mingw ; then
116118
M2_HOME="`(cd "$M2_HOME"; pwd)`"
117119
[ -n "$JAVA_HOME" ] &&
118120
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
119-
# TODO classpath?
120121
fi
121122

122123
if [ -z "$JAVA_HOME" ]; then
@@ -148,7 +149,7 @@ if [ -z "$JAVACMD" ] ; then
148149
JAVACMD="$JAVA_HOME/bin/java"
149150
fi
150151
else
151-
JAVACMD="`which java`"
152+
JAVACMD="`\\unset -f command; \\command -v java`"
152153
fi
153154
fi
154155

@@ -207,35 +208,71 @@ fi
207208
# This allows using the maven wrapper in projects that prohibit checking in binary data.
208209
##########################################################################################
209210
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
210-
echo "Found .mvn/wrapper/maven-wrapper.jar"
211+
if [ "$MVNW_VERBOSE" = true ]; then
212+
echo "Found .mvn/wrapper/maven-wrapper.jar"
213+
fi
211214
else
212-
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
213-
214-
jarUrl="https://repo1.maven.org/maven2/io/takari/maven-wrapper/0.2.1/maven-wrapper-0.2.1.jar"
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
215223
while IFS="=" read key value; do
216224
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
217225
esac
218226
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
219-
echo "Downloading from: $jarUrl"
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
220234

221235
if command -v wget > /dev/null; then
222-
echo "Found wget ... using wget"
223-
wget -O "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" "$jarUrl"
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
224244
elif command -v curl > /dev/null; then
225-
echo "Found curl ... using curl"
226-
curl -o "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" "$jarUrl"
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+
227254
else
228-
echo "Falling back to using Java to download"
255+
if [ "$MVNW_VERBOSE" = true ]; then
256+
echo "Falling back to using Java to download"
257+
fi
229258
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
230263
if [ -e "$javaClass" ]; then
231264
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
232-
echo " - Compiling MavenWrapperDownloader.java ..."
265+
if [ "$MVNW_VERBOSE" = true ]; then
266+
echo " - Compiling MavenWrapperDownloader.java ..."
267+
fi
233268
# Compiling the Java class
234269
("$JAVA_HOME/bin/javac" "$javaClass")
235270
fi
236271
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
237272
# Running the downloader
238-
echo " - Running MavenWrapperDownloader.java ..."
273+
if [ "$MVNW_VERBOSE" = true ]; then
274+
echo " - Running MavenWrapperDownloader.java ..."
275+
fi
239276
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
240277
fi
241278
fi
@@ -246,7 +283,9 @@ fi
246283
##########################################################################################
247284

248285
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
249-
echo $MAVEN_PROJECTBASEDIR
286+
if [ "$MVNW_VERBOSE" = true ]; then
287+
echo $MAVEN_PROJECTBASEDIR
288+
fi
250289
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
251290

252291
# For Cygwin, switch paths to Windows format before running java
@@ -261,10 +300,17 @@ if $cygwin; then
261300
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
262301
fi
263302

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+
264308
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
265309

266310
exec "$JAVACMD" \
267311
$MAVEN_OPTS \
312+
$MAVEN_DEBUG_OPTS \
268313
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
269-
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
270-
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
314+
"-Dmaven.home=${M2_HOME}" \
315+
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
316+
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

0 commit comments

Comments
 (0)