This is an automated email from the ASF dual-hosted git repository.

yihua pushed a commit to branch release-1.2.0
in repository https://gitbox.apache.org/repos/asf/hudi.git

commit e9120c9378a3a29ec9c7d47d14003dfe65b56ad9
Author: Y Ethan Guo <[email protected]>
AuthorDate: Fri May 15 12:34:34 2026 -0700

    chore: Update scripts to deploy staging jars as part of the release process 
(#18748)
---
 release/release_guide.md                      |  6 +-
 scripts/release/deploy_staging_jars.sh        | 23 ++++++--
 scripts/release/deploy_staging_jars_java11.sh | 82 ---------------------------
 scripts/release/deploy_staging_jars_java17.sh | 11 ++++
 4 files changed, 32 insertions(+), 90 deletions(-)

diff --git a/release/release_guide.md b/release/release_guide.md
index 7fa77e44bd7f..4978f116e685 100644
--- a/release/release_guide.md
+++ b/release/release_guide.md
@@ -409,9 +409,9 @@ Set up a few environment variables to simplify Maven 
commands that follow. This
    2. Review all staged artifacts (https://repository.apache.org/). They 
should contain all relevant parts for each module, including pom.xml, jar, test 
jar, source, test source, javadoc, etc. Carefully review any new artifacts.
    3. git checkout ${RELEASE_BRANCH}
    4. Given that certain bundle jars are built by Java 17 (Spark 4 bundle), 
multiple
-      scripts need to be run
+      scripts need to be run. Run each from the repository root directory (the 
one containing `packaging/`).
        1. For most modules with Java 11 build, run `export 
JAVA_HOME=$(/usr/libexec/java_home -v 11)` and
-          `/scripts/release/deploy_staging_jars.sh 2>&1 | tee -a 
"/tmp/${RELEASE_VERSION}-${RC_NUM}.deploy1.log"`
+          `./scripts/release/deploy_staging_jars.sh 2>&1 | tee -a 
"/tmp/${RELEASE_VERSION}-${RC_NUM}.deploy1.log"`
            1. when prompted for the passphrase, if you have multiple gpg keys 
in your keyring, make sure that you enter
               the right passphase corresponding to the same key (FINGERPRINT) 
as used while generating source release in
               step 6.2.
@@ -424,7 +424,7 @@ Set up a few environment variables to simplify Maven 
commands that follow. This
               please ensure that you have docker daemon running. This is 
required to build `hudi-metaserver-server`
               module. See [checklist](#checklist-to-proceed-to-the-next-step).
        2. Continue with Java 17 build for Spark 4 bundle, run `export 
JAVA_HOME=$(/usr/libexec/java_home -v 17)` and
-          `/scripts/release/deploy_staging_jars_java17.sh 2>&1 | tee -a 
"/tmp/${RELEASE_VERSION}-${RC_NUM}.deploy2.log"`
+          `./scripts/release/deploy_staging_jars_java17.sh 2>&1 | tee -a 
"/tmp/${RELEASE_VERSION}-${RC_NUM}.deploy2.log"`
    5. Note that the artifacts from Java 17 build are uploaded to a separate 
staging repo. You need to manually
       download those artifacts and upload them to the first staging repo so 
that all artifacts stay in the same repo.
    6. Review all staged artifacts by logging into Apache Nexus and clicking on 
"Staging Repositories" link on left pane.
diff --git a/scripts/release/deploy_staging_jars.sh 
b/scripts/release/deploy_staging_jars.sh
index 5906ce65f60f..f8c097de9c0a 100755
--- a/scripts/release/deploy_staging_jars.sh
+++ b/scripts/release/deploy_staging_jars.sh
@@ -31,6 +31,17 @@ if [ ! -d "$CURR_DIR/packaging" ] ; then
   exit 1
 fi
 
+# Validate Java version (expects Java 11, matching <java.version> in pom.xml)
+EXPECTED_JAVA_VERSION=11
+JAVA_VERSION_OUTPUT=$("${JAVA_HOME:+$JAVA_HOME/bin/}java" -version 2>&1)
+JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION_OUTPUT" | awk -F[\".] '/version/ 
{print ($2 == "1" ? $3 : $2); exit}')
+if [ "$JAVA_MAJOR_VERSION" != "$EXPECTED_JAVA_VERSION" ]; then
+  echo "Error: Java $EXPECTED_JAVA_VERSION is required for this script, but 
found:"
+  echo "$JAVA_VERSION_OUTPUT"
+  echo "Set JAVA_HOME to a Java $EXPECTED_JAVA_VERSION installation and retry."
+  exit 1
+fi
+
 if [ "$#" -gt "1" ]; then
   echo "Only accept 0 or 1 argument. Use -h to see examples."
   exit 1
@@ -56,16 +67,18 @@ declare -a ALL_VERSION_OPTS=(
 # hudi-spark3.4-bundle_2.12
 "-T 1C -Dscala-2.12 -Dspark3.4 -pl 
hudi-spark-datasource/hudi-spark3.4.x,packaging/hudi-spark-bundle -am"
 # For all modules spark3.5
-"-Dscala-2.12 -Dspark3.5"
+"-Dscala-2.12 -Dspark3.5 -Dflink1.20 -Ddocker.compose.skip=true"
 
 # Upload legacy Spark bundles (not overwriting previous uploads as these jar 
names are unique)
 "-T 1C -Dscala-2.12 -Dspark3 -pl packaging/hudi-spark-bundle -am" # for legacy 
bundle name hudi-spark3-bundle_2.12
 
 # Upload Flink bundles (overwriting previous uploads)
-"-T 1C -Dscala-2.12 -Dflink1.17 -Davro.version=1.11.4 -Dparquet.version=1.12.3 
-pl packaging/hudi-flink-bundle -am"
-"-T 1C -Dscala-2.12 -Dflink1.18 -Davro.version=1.11.4 -Dparquet.version=1.13.1 
-pl packaging/hudi-flink-bundle -am"
-"-T 1C -Dscala-2.12 -Dflink1.19 -Davro.version=1.11.4 -Dparquet.version=1.13.1 
-pl packaging/hudi-flink-bundle -am"
-"-T 1C -Dscala-2.12 -Dflink1.20 -Davro.version=1.11.4 -Dparquet.version=1.13.1 
-pl packaging/hudi-flink-bundle -am"
+"-T 1C -Dscala-2.12 -Dspark3.5 -Dflink1.17 -Davro.version=1.11.4 
-Dparquet.version=1.12.3 -pl packaging/hudi-flink-bundle -am"
+"-T 1C -Dscala-2.12 -Dspark3.5 -Dflink1.18 -Davro.version=1.11.4 
-Dparquet.version=1.13.1 -pl packaging/hudi-flink-bundle -am"
+"-T 1C -Dscala-2.12 -Dspark3.5 -Dflink1.19 -Davro.version=1.11.4 
-Dparquet.version=1.13.1 -pl packaging/hudi-flink-bundle -am"
+"-T 1C -Dscala-2.12 -Dspark3.5 -Dflink1.20 -Davro.version=1.11.4 
-Dparquet.version=1.13.1 -pl packaging/hudi-flink-bundle -am"
+"-T 1C -Dscala-2.12 -Dspark3.5 -Dflink2.0 -Davro.version=1.11.4 
-Dparquet.version=1.14.4 -pl packaging/hudi-flink-bundle -am"
+"-T 1C -Dscala-2.12 -Dspark3.5 -Dflink2.1 -Davro.version=1.11.4 
-Dparquet.version=1.15.2 -pl packaging/hudi-flink-bundle -am"
 )
 printf -v joined "'%s'\n" "${ALL_VERSION_OPTS[@]}"
 
diff --git a/scripts/release/deploy_staging_jars_java11.sh 
b/scripts/release/deploy_staging_jars_java11.sh
deleted file mode 100755
index 18d15df02256..000000000000
--- a/scripts/release/deploy_staging_jars_java11.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/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.
-#
-
-##
-## Variables with defaults (if not overwritten by environment)
-##
-MVN=${MVN:-mvn}
-# fail immediately
-set -o errexit
-set -o nounset
-
-CURR_DIR=$(pwd)
-if [ ! -d "$CURR_DIR/packaging" ] ; then
-  echo "You have to call the script from the repository root dir that contains 
'packaging/'"
-  exit 1
-fi
-
-if [ "$#" -gt "1" ]; then
-  echo "Only accept 0 or 1 argument. Use -h to see examples."
-  exit 1
-fi
-
-declare -a ALL_VERSION_OPTS=(
-"-T 1C -Dscala-2.12 -Dflink2.0 -Davro.version=1.11.4 -Dparquet.version=1.14.4 
-pl packaging/hudi-flink-bundle -am"
-)
-printf -v joined "'%s'\n" "${ALL_VERSION_OPTS[@]}"
-
-if [ "${1:-}" == "-h" ]; then
-  echo "
-Usage: $(basename "$0") [OPTIONS]
-
-Options:
-<version option>  One of the version options below
-${joined}
--h, --help
-"
-  exit 0
-fi
-
-VERSION_OPT=${1:-}
-valid_version_opt=false
-for v in "${ALL_VERSION_OPTS[@]}"; do
-    [[ $VERSION_OPT == "$v" ]] && valid_version_opt=true
-done
-
-if [ "$valid_version_opt" = true ]; then
-  # run deploy for only specified version option
-  ALL_VERSION_OPTS=("$VERSION_OPT")
-elif [ "$#" == "1" ]; then
-  echo "Version option $VERSION_OPT is invalid. Use -h to see examples."
-  exit 1
-fi
-
-COMMON_OPTIONS="-DdeployArtifacts=true -DskipTests 
-DretryFailedDeploymentCount=10"
-for v in "${ALL_VERSION_OPTS[@]}"
-do
-  # TODO: consider cleaning all modules by listing directories instead of 
specifying profile
-  echo "Cleaning everything before any deployment"
-  $MVN clean $COMMON_OPTIONS ${v}
-  echo "Building with options ${v}"
-  $MVN install $COMMON_OPTIONS ${v}
-
-  echo "Deploying to repository.apache.org with version options ${v%-am}"
-  # remove `-am` option to only deploy intended modules
-  $MVN deploy $COMMON_OPTIONS ${v%-am}
-done
diff --git a/scripts/release/deploy_staging_jars_java17.sh 
b/scripts/release/deploy_staging_jars_java17.sh
index c034f15d3c97..dcdc9164d18c 100755
--- a/scripts/release/deploy_staging_jars_java17.sh
+++ b/scripts/release/deploy_staging_jars_java17.sh
@@ -31,6 +31,17 @@ if [ ! -d "$CURR_DIR/packaging" ] ; then
   exit 1
 fi
 
+# Validate Java version (Spark 4.x requires Java 17)
+EXPECTED_JAVA_VERSION=17
+JAVA_VERSION_OUTPUT=$("${JAVA_HOME:+$JAVA_HOME/bin/}java" -version 2>&1)
+JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION_OUTPUT" | awk -F[\".] '/version/ 
{print ($2 == "1" ? $3 : $2); exit}')
+if [ "$JAVA_MAJOR_VERSION" != "$EXPECTED_JAVA_VERSION" ]; then
+  echo "Error: Java $EXPECTED_JAVA_VERSION is required for this script, but 
found:"
+  echo "$JAVA_VERSION_OUTPUT"
+  echo "Set JAVA_HOME to a Java $EXPECTED_JAVA_VERSION installation and retry."
+  exit 1
+fi
+
 if [ "$#" -gt "1" ]; then
   echo "Only accept 0 or 1 argument. Use -h to see examples."
   exit 1

Reply via email to