This is an automated email from the ASF dual-hosted git repository.
jinsongzhou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git
The following commit(s) were added to refs/heads/master by this push:
new e2e67a025 [AMORO-3852][BUILD] Enhance build system (#3849)
e2e67a025 is described below
commit e2e67a025eec6a1326786f2e5ef4a065c7424376
Author: Fei Wang <[email protected]>
AuthorDate: Sun Nov 2 19:51:54 2025 -0800
[AMORO-3852][BUILD] Enhance build system (#3849)
* Build project with fixed version
check-latest: false
GA
* docs
* shell
---
.github/workflows/core-hadoop2-ci.yml | 5 +-
.github/workflows/core-hadoop3-ci.yml | 5 +-
.github/workflows/docker-images.yml | 9 +-
.github/workflows/openapi-sdk-ci.yml | 3 +-
.github/workflows/trino-ci.yml | 5 +-
.gitignore | 2 +-
CONTRIBUTING.md | 2 +-
README.md | 28 +++---
amoro-common/pom.xml | 2 +-
build/mvn | 112 +++++++++++++++++++++
docker/README.md | 2 +-
docker/build.sh | 8 +-
docs/admin-guides/deployment.md | 2 +-
...tomized-encryption-method-for-configurations.md | 2 +-
docs/engines/flink/flink-get-started.md | 2 +-
pom.xml | 1 +
tools/releasing/create_binary_release.sh | 4 +-
tools/releasing/create_source_release.sh | 3 +-
18 files changed, 161 insertions(+), 36 deletions(-)
diff --git a/.github/workflows/core-hadoop2-ci.yml
b/.github/workflows/core-hadoop2-ci.yml
index bf03c7612..95406eeed 100644
--- a/.github/workflows/core-hadoop2-ci.yml
+++ b/.github/workflows/core-hadoop2-ci.yml
@@ -48,12 +48,13 @@ jobs:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: maven
+ check-latest: false
- name: Validate checkstyle first
- run: mvn validate
+ run: build/mvn validate
- name: Build all modules with Maven
- run: mvn clean install -Djacoco.flink.skip=true -B -ntp -Phadoop2
-Pjava${{ matrix.jdk }}
+ run: build/mvn clean install -Djacoco.flink.skip=true -B -ntp
-Phadoop2 -Pjava${{ matrix.jdk }}
- name: Code coverage
uses: codecov/codecov-action@v3
diff --git a/.github/workflows/core-hadoop3-ci.yml
b/.github/workflows/core-hadoop3-ci.yml
index 5440afcbc..8a45c7305 100644
--- a/.github/workflows/core-hadoop3-ci.yml
+++ b/.github/workflows/core-hadoop3-ci.yml
@@ -49,12 +49,13 @@ jobs:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: maven
+ check-latest: false
- name: Validate checkstyle first
- run: mvn validate
+ run: build/mvn validate
- name: Build all modules with Maven
- run: mvn clean install -Djacoco.flink.skip=true -B -ntp -Pjava${{
matrix.jdk }} -Pspark-${{ matrix.spark }}
+ run: build/mvn clean install -Djacoco.flink.skip=true -B -ntp
-Pjava${{ matrix.jdk }} -Pspark-${{ matrix.spark }}
- name: Code coverage
uses: codecov/codecov-action@v3
diff --git a/.github/workflows/docker-images.yml
b/.github/workflows/docker-images.yml
index 343960ed0..29cfeb16f 100644
--- a/.github/workflows/docker-images.yml
+++ b/.github/workflows/docker-images.yml
@@ -49,6 +49,7 @@ jobs:
java-version: '11'
distribution: 'temurin'
cache: maven
+ check-latest: false
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
@@ -86,7 +87,7 @@ jobs:
echo "MVN_HADOOP=-Phadoop2" >> $GITHUB_ENV
- name: Build dist module with Maven
- run: mvn clean package -pl 'dist' -am -e ${MVN_HADOOP} -DskipTests -B
-ntp -Psupport-all-formats
+ run: build/mvn clean package -pl 'dist' -am -e ${MVN_HADOOP}
-DskipTests -B -ntp -Psupport-all-formats
- name: Build and Push Amoro Docker Image
uses: docker/build-push-action@v4
@@ -112,6 +113,7 @@ jobs:
java-version: '11'
distribution: 'temurin'
cache: maven
+ check-latest: false
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
@@ -162,7 +164,7 @@ jobs:
&& echo "AMORO_VERSION=${AMORO_VERSION}" >> $GITHUB_OUTPUT
- name: Build optimizer module with Maven
- run: mvn clean package -pl 'amoro-optimizer/amoro-optimizer-flink' -am
-e ${OPTIMIZER_FLINK} -DskipTests -B -ntp
+ run: build/mvn clean package -pl
'amoro-optimizer/amoro-optimizer-flink' -am -e ${OPTIMIZER_FLINK} -DskipTests
-B -ntp
- name: Build and Push Flink Optimizer Docker Image
uses: docker/build-push-action@v4
@@ -193,6 +195,7 @@ jobs:
java-version: '11'
distribution: 'temurin'
cache: maven
+ check-latest: false
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
@@ -237,7 +240,7 @@ jobs:
&& echo "AMORO_VERSION=${AMORO_VERSION}" >> $GITHUB_OUTPUT
- name: Build optimizer module with Maven
- run: mvn clean package -pl 'amoro-optimizer/amoro-optimizer-spark' -am
-e ${OPTIMIZER_SPARK} -DskipTests -B -ntp
+ run: build/mvn clean package -pl
'amoro-optimizer/amoro-optimizer-spark' -am -e ${OPTIMIZER_SPARK} -DskipTests
-B -ntp
- name: Build and Push Spark Optimizer Docker Image
uses: docker/build-push-action@v4
diff --git a/.github/workflows/openapi-sdk-ci.yml
b/.github/workflows/openapi-sdk-ci.yml
index 484f4bacb..00768e80a 100644
--- a/.github/workflows/openapi-sdk-ci.yml
+++ b/.github/workflows/openapi-sdk-ci.yml
@@ -51,6 +51,7 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: maven
+ check-latest: false
- name: Build OpenAPI SDK
- run: mvn clean package -DskipTests -Pgenerate-sdk -pl amoro-ams -am
+ run: build/mvn clean package -DskipTests -Pgenerate-sdk -pl amoro-ams
-am
diff --git a/.github/workflows/trino-ci.yml b/.github/workflows/trino-ci.yml
index 6dc4336ee..fb752033a 100644
--- a/.github/workflows/trino-ci.yml
+++ b/.github/workflows/trino-ci.yml
@@ -38,12 +38,13 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: maven
+ check-latest: false
- name: Validate checkstyle first
- run: mvn validate -P format-mixed-format-trino
+ run: build/mvn validate -P format-mixed-format-trino
- name: Build trino module with Maven
- run: mvn clean install -pl 'amoro-format-mixed/amoro-mixed-trino' -am
-B -P hadoop2,format-mixed-format-trino,build-mixed-format-trino
+ run: build/mvn clean install -pl
'amoro-format-mixed/amoro-mixed-trino' -am -B -P
hadoop2,format-mixed-format-trino,build-mixed-format-trino
- name: Code coverage
uses: codecov/codecov-action@v3
diff --git a/.gitignore b/.gitignore
index 435bca0a2..7a006ccb3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,7 +14,7 @@
# gradle build
.gradle
-build
+build/apache-maven*
gradle/
out
gradle/wrapper/gradle-wrapper.jar
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index be16e70ba..618305ce8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -181,7 +181,7 @@ Amoro uses
[Spotless](https://github.com/diffplug/spotless/tree/main/plugin-mave
[google-java-format](https://github.com/google/google-java-format) to format
the Java code. For
Scala, it uses Spotless with [scalafmt](https://scalameta.org/scalafmt/).
-You can format your code by executing the command `mvn spotless:apply` in the
root directory of
+You can format your code by executing the command `build/mvn spotless:apply`
in the root directory of
project.
Or you can configure your IDEA to automatically format your code. Then you
will need to install
diff --git a/README.md b/README.md
index 6e1944bac..f68ab53a1 100644
--- a/README.md
+++ b/README.md
@@ -118,20 +118,20 @@ Amoro contains modules as below:
Amoro is built using Maven with JDK 8, 11 and 17(required for
`amoro-format-mixed/amoro-mixed-trino` module).
-* Build all modules without `amoro-mixed-trino`: `mvn clean package`
-* Build and skip tests: `mvn clean package -DskipTests`
-* Build and skip dashboard: `mvn clean package -Pskip-dashboard-build`
-* Build and disable disk storage, RocksDB will NOT be introduced to avoid
memory overflow: `mvn clean package -DskipTests -Pno-extented-disk-storage`
-* Build and enable aliyun-oss-sdk: `mvn clean package -DskipTests
-Paliyun-oss-sdk`
-* Build with hadoop 2.x(the default is 3.x) dependencies: `mvn clean package
-DskipTests -Phadoop2`
-* Specify Flink version for Flink optimizer(the default is 1.20.0): `mvn clean
package -DskipTests -Dflink-optimizer.flink-version=1.20.0`
- * If the version of Flink is below 1.15.0, you also need to add the
`-Pflink-optimizer-pre-1.15` parameter: `mvn clean package -DskipTests
-Pflink-optimizer-pre-1.15 -Dflink-optimizer.flink-version=1.14.6`
-* Specify Spark version for Spark optimizer(the default is 3.3.3): `mvn clean
package -DskipTests -Dspark-optimizer.spark-version=3.3.3`
-* Build `amoro-mixed-trino` module under JDK 17: `mvn clean package
-DskipTests -Pformat-mixed-format-trino,build-mixed-format-trino -pl
'amoro-format-mixed/amoro-mixed-trino' -am`.
-* Build all modules: `mvn clean package -DskipTests
-Ptoolchain,build-mixed-format-trino`, besides you need config `toolchains.xml`
in `${user.home}/.m2/` dir with content below.
-* Build a distribution package with all formats integrated: `mvn clean package
-Psupport-all-formats`
- * Build a distribution package with Apache Paimon format: `mvn clean package
-Psupport-paimon-format`
- * Build a distribution package with Apache Hudi format: `mvn clean package
-Psupport-hudi-format`
+* Build all modules without `amoro-mixed-trino`: `build/mvn clean package`
+* Build and skip tests: `build/mvn clean package -DskipTests`
+* Build and skip dashboard: `build/mvn clean package -Pskip-dashboard-build`
+* Build and disable disk storage, RocksDB will NOT be introduced to avoid
memory overflow: `build/mvn clean package -DskipTests
-Pno-extented-disk-storage`
+* Build and enable aliyun-oss-sdk: `build/mvn clean package -DskipTests
-Paliyun-oss-sdk`
+* Build with hadoop 2.x(the default is 3.x) dependencies: `build/mvn clean
package -DskipTests -Phadoop2`
+* Specify Flink version for Flink optimizer(the default is 1.20.0): `build/mvn
clean package -DskipTests -Dflink-optimizer.flink-version=1.20.0`
+ * If the version of Flink is below 1.15.0, you also need to add the
`-Pflink-optimizer-pre-1.15` parameter: `build/mvn clean package -DskipTests
-Pflink-optimizer-pre-1.15 -Dflink-optimizer.flink-version=1.14.6`
+* Specify Spark version for Spark optimizer(the default is 3.3.3): `build/mvn
clean package -DskipTests -Dspark-optimizer.spark-version=3.3.3`
+* Build `amoro-mixed-trino` module under JDK 17: `build/mvn clean package
-DskipTests -Pformat-mixed-format-trino,build-mixed-format-trino -pl
'amoro-format-mixed/amoro-mixed-trino' -am`.
+* Build all modules: `build/mvn clean package -DskipTests
-Ptoolchain,build-mixed-format-trino`, besides you need config `toolchains.xml`
in `${user.home}/.m2/` dir with content below.
+* Build a distribution package with all formats integrated: `build/mvn clean
package -Psupport-all-formats`
+ * Build a distribution package with Apache Paimon format: `build/mvn clean
package -Psupport-paimon-format`
+ * Build a distribution package with Apache Hudi format: `build/mvn clean
package -Psupport-hudi-format`
```
<?xml version="1.0" encoding="UTF-8"?>
diff --git a/amoro-common/pom.xml b/amoro-common/pom.xml
index 3075fd9ac..b9ef090a8 100644
--- a/amoro-common/pom.xml
+++ b/amoro-common/pom.xml
@@ -165,7 +165,7 @@
</executions>
</plugin>
- <!--Compile thrift api with commend: mvn thrift:compile -pl
amoro-common-->
+ <!--Compile thrift api with commend: build/mvn thrift:compile -pl
amoro-common-->
<plugin>
<groupId>org.apache.thrift.tools</groupId>
<artifactId>maven-thrift-plugin</artifactId>
diff --git a/build/mvn b/build/mvn
new file mode 100755
index 000000000..cd6c0c796
--- /dev/null
+++ b/build/mvn
@@ -0,0 +1,112 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Determine the current working directory
+_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+# Preserve the calling directory
+_CALLING_DIR="$(pwd)"
+# Options used during compilation
+_COMPILE_JVM_OPTS="-Xms2g -Xmx2g -XX:ReservedCodeCacheSize=1g -Xss128m"
+
+if [ "$CI" ]; then
+ export MAVEN_CLI_OPTS="--no-transfer-progress --errors --fail-fast"
+fi
+
+# Installs any application tarball given a URL, the expected tarball name,
+# and, optionally, a checkable binary path to determine if the binary has
+# already been installed
+## Arg1 - URL
+## Arg2 - Tarball Name
+## Arg3 - Checkable Binary
+install_app() {
+ local remote_tarball="$1/$2$4"
+ local local_tarball="${_DIR}/$2"
+ local binary="${_DIR}/$3"
+
+ # setup `curl` and `wget` silent options if we're running on Jenkins
+ local curl_opts="-L"
+ local wget_opts=""
+ curl_opts="--progress-bar ${curl_opts}"
+ wget_opts="--progress=bar:force ${wget_opts}"
+
+ if [ -z "$3" -o ! -f "$binary" ]; then
+ # check if we already have the tarball
+ # check if we have curl installed
+ # download application
+ [ ! -f "${local_tarball}" ] && [ $(command -v curl) ] && \
+ echo "exec: curl ${curl_opts} ${remote_tarball}" 1>&2 && \
+ curl ${curl_opts} "${remote_tarball}" > "${local_tarball}"
+ # if the file still doesn't exist, lets try `wget` and cross our fingers
+ [ ! -f "${local_tarball}" ] && [ $(command -v wget) ] && \
+ echo "exec: wget ${wget_opts} ${remote_tarball}" 1>&2 && \
+ wget ${wget_opts} -O "${local_tarball}" "${remote_tarball}"
+ # if both were unsuccessful, exit
+ [ ! -f "${local_tarball}" ] && \
+ echo -n "ERROR: Cannot download $2 with cURL or wget; " && \
+ echo "please install manually and try again." && \
+ exit 2
+ cd "${_DIR}" && tar -xzf "$2"
+ rm -rf "$local_tarball"
+ fi
+}
+
+# Determine the Maven version from the root pom.xml file and
+# install maven under the build/ folder if needed.
+install_mvn() {
+ local MVN_VERSION=`grep "<maven.version>" "${_DIR}/../pom.xml" | head -n1 |
awk -F '[<>]' '{print $3}'`
+ MVN_BIN="$(command -v mvn)"
+ if [ "$MVN_BIN" ]; then
+ local MVN_DETECTED_VERSION="$(mvn --version | head -n1 | awk '{print $3}')"
+ fi
+ # See simple version normalization:
http://stackoverflow.com/questions/16989598/bash-comparing-version-numbers
+ function version { echo "$@" | awk -F. '{ printf("%03d%03d%03d\n",
$1,$2,$3); }'; }
+ if [ $(version $MVN_DETECTED_VERSION) -ne $(version $MVN_VERSION) ]; then
+ local
APACHE_MIRROR=${APACHE_MIRROR:-'https://www.apache.org/dyn/closer.lua'}
+ local MIRROR_URL_QUERY="?action=download"
+ local MVN_TARBALL="apache-maven-${MVN_VERSION}-bin.tar.gz"
+ local FILE_PATH="maven/maven-3/${MVN_VERSION}/binaries"
+
+ if [ $(command -v curl) ]; then
+ if ! curl -L --output /dev/null --silent --head --fail
"${APACHE_MIRROR}/${FILE_PATH}/${MVN_TARBALL}${MIRROR_URL_QUERY}" ; then
+ # Fall back to archive.apache.org for older Maven
+ echo "Falling back to archive.apache.org to download Maven"
+ APACHE_MIRROR="https://archive.apache.org/dist"
+ MIRROR_URL_QUERY=""
+ fi
+ fi
+
+ install_app \
+ "${APACHE_MIRROR}/${FILE_PATH}" \
+ "${MVN_TARBALL}" \
+ "apache-maven-${MVN_VERSION}/bin/mvn" \
+ "${MIRROR_URL_QUERY}"
+
+ MVN_BIN="${_DIR}/apache-maven-${MVN_VERSION}/bin/mvn"
+ fi
+}
+
+install_mvn
+
+cd "${_CALLING_DIR}"
+
+# Set any `mvn` options if not already present
+export MAVEN_OPTS=${MAVEN_OPTS:-"$_COMPILE_JVM_OPTS"}
+
+echo "Using \`mvn\` from path: $MVN_BIN" 1>&2
+${MVN_BIN} $MAVEN_CLI_OPTS "$@"
diff --git a/docker/README.md b/docker/README.md
index 5d4b5d44c..a120715fd 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -32,7 +32,7 @@ e.g.
```
- NOTICE: The amoro image, amoro-spark-optimizer image and
amoro-flink-optimizer image required the project had been packaged.
- So run `mvn clean package -DskipTests` before building amoro,
amoro-spark-optimizer, or amoro-flink-optimizer image.
+ So run `build/mvn clean package -DskipTests` before building amoro,
amoro-spark-optimizer, or amoro-flink-optimizer image.
You can speed up image building via
diff --git a/docker/build.sh b/docker/build.sh
index 99fe3143e..583fb4de7 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -21,6 +21,8 @@ CURRENT_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
PROJECT_HOME="$( cd "$CURRENT_DIR/../" ; pwd -P )"
export PROJECT_HOME
+MVN="${PROJECT_HOME}/build/mvn"
+
cd $CURRENT_DIR
AMORO_VERSION=`cat $PROJECT_HOME/pom.xml | grep 'amoro-parent' -C 3 | grep -Eo
'<version>.*</version>' | awk -F'[><]' '{print $3}'`
@@ -160,7 +162,7 @@ function build_optimizer_flink() {
OPTIMIZER_JOB=${FLINK_OPTIMIZER_JOB}
if [ ! -f "${OPTIMIZER_JOB}" ]; then
- BUILD_CMD="mvn clean package -pl amoro-optimizer/amoro-optimizer-flink
-am -e -DskipTests"
+ BUILD_CMD="$MVN clean package -pl amoro-optimizer/amoro-optimizer-flink
-am -e -DskipTests"
echo "flink optimizer job not exists in ${OPTIMIZER_JOB}"
echo "please check the file or run '${BUILD_CMD}' first. "
exit 1
@@ -183,7 +185,7 @@ function build_optimizer_spark() {
OPTIMIZER_JOB=${SPARK_OPTIMIZER_JOB}
if [ ! -f "${OPTIMIZER_JOB}" ]; then
- BUILD_CMD="mvn clean package -pl amoro-optimizer/amoro-optimizer-spark
-am -e -DskipTests"
+ BUILD_CMD="$MVN clean package -pl amoro-optimizer/amoro-optimizer-spark
-am -e -DskipTests"
echo "spark optimizer job not exists in ${OPTIMIZER_JOB}"
echo "please check the file or run '${BUILD_CMD}' first. "
exit 1
@@ -206,7 +208,7 @@ function build_amoro() {
local
DIST_FILE=${PROJECT_HOME}/dist/target/apache-amoro-${AMORO_VERSION}-bin.tar.gz
if [ ! -f "${DIST_FILE}" ]; then
- local BUILD_CMD="mvn clean package -am -e -pl dist -DskipTests "
+ local BUILD_CMD="$MVN clean package -am -e -pl dist -DskipTests "
echo "Amoro dist package is not exists in ${DIST_FILE}"
echo "please check file or run '$BUILD_CMD' first"
exit 1
diff --git a/docs/admin-guides/deployment.md b/docs/admin-guides/deployment.md
index 779e5d256..d5cc54d59 100644
--- a/docs/admin-guides/deployment.md
+++ b/docs/admin-guides/deployment.md
@@ -48,7 +48,7 @@ You can build based on the master branch without compiling
Trino. The compilatio
$ git clone https://github.com/apache/amoro.git
$ cd amoro
$ base_dir=$(pwd)
-$ mvn clean package -DskipTests
+$ build/mvn clean package -DskipTests
$ cd dist/target/
$ ls
amoro-x.y.z-bin.zip # AMS release package
diff --git
a/docs/admin-guides/using-customized-encryption-method-for-configurations.md
b/docs/admin-guides/using-customized-encryption-method-for-configurations.md
index 30235abb5..b76bea8c4 100644
--- a/docs/admin-guides/using-customized-encryption-method-for-configurations.md
+++ b/docs/admin-guides/using-customized-encryption-method-for-configurations.md
@@ -107,7 +107,7 @@ com.example.shade.Base64CustomConfigShade
### Build the JAR
Package your implementation into a JAR file using Maven:
```shell
-mvn clean package
+build/mvn clean package
```
## Deploy the Custom Implementation
diff --git a/docs/engines/flink/flink-get-started.md
b/docs/engines/flink/flink-get-started.md
index 0a28c402f..ec8c3cdc7 100644
--- a/docs/engines/flink/flink-get-started.md
+++ b/docs/engines/flink/flink-get-started.md
@@ -54,7 +54,7 @@ Flink Connector includes:
The Amoro project can be self-compiled to obtain the runtime jar.
-`mvn clean package -pl ':amoro-mixed-flink-runtime-1.15' -am -DskipTests`
+`build/mvn clean package -pl ':amoro-mixed-flink-runtime-1.15' -am -DskipTests`
The Flink Runtime Jar is located in the
`amoro-format-mixed/amoro-format-mixed-flink/v1.15/amoro-format-mixed-flink-runtime-1.15/target`
directory.
diff --git a/pom.xml b/pom.xml
index a102bde43..36bc38357 100644
--- a/pom.xml
+++ b/pom.xml
@@ -75,6 +75,7 @@
<java.target.version>11</java.target.version>
<maven.compiler.source>${java.source.version}</maven.compiler.source>
<maven.compiler.target>${java.target.version}</maven.compiler.target>
+ <maven.version>3.9.9</maven.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputTimestamp>2024-06-27T08:00:00Z</project.build.outputTimestamp>
diff --git a/tools/releasing/create_binary_release.sh
b/tools/releasing/create_binary_release.sh
index 50815007e..056781436 100644
--- a/tools/releasing/create_binary_release.sh
+++ b/tools/releasing/create_binary_release.sh
@@ -21,7 +21,9 @@
## Variables with defaults (if not overwritten by environment)
##
SKIP_GPG=${SKIP_GPG:-false}
-MVN=${MVN:-mvn}
+
+PROJECT_HOME=$(cd "$(dirname "$0")"/../.. || exit; pwd)
+MVN="${PROJECT_HOME}/build/mvn"
if [ -z "${RELEASE_VERSION:-}" ]; then
echo "RELEASE_VERSION was not set."
diff --git a/tools/releasing/create_source_release.sh
b/tools/releasing/create_source_release.sh
index ffb86a0fe..a5af3fe36 100644
--- a/tools/releasing/create_source_release.sh
+++ b/tools/releasing/create_source_release.sh
@@ -20,7 +20,8 @@
##
## Variables with defaults (if not overwritten by environment)
##
-MVN=${MVN:-mvn}
+PROJECT_HOME=$(cd "$(dirname "$0")"/../.. || exit; pwd)
+MVN="${PROJECT_HOME}/build/mvn"
if [ -z "${RELEASE_VERSION:-}" ]; then
echo "RELEASE_VERSION was not set."