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

kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 9ec01da  ARROW-13051: [Release][Java] Use artifacts built by Crossbow
9ec01da is described below

commit 9ec01da19124ee93965879d11bc60538dbbe7693
Author: Sutou Kouhei <[email protected]>
AuthorDate: Thu Dec 2 11:48:11 2021 +0900

    ARROW-13051: [Release][Java] Use artifacts built by Crossbow
    
    Closes #11696 from kou/release-java-nexus
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 dev/release/05-binary-upload.sh              |   4 -
 dev/release/06-java-upload.sh                | 140 +++++++++++++++++++++++++++
 dev/release/binary-task.rb                   |  11 ---
 dev/release/download_rc_binaries.py          |  60 +++++++-----
 dev/release/post-03-binary.sh                |   4 -
 dev/release/{post-13-go.sh => post-11-go.sh} |   0
 dev/release/post-11-java.sh                  |  81 ----------------
 dev/release/verify-release-candidate.sh      | 136 +++++++++++++++++---------
 dev/tasks/tasks.yml                          |  14 ++-
 9 files changed, 279 insertions(+), 171 deletions(-)

diff --git a/dev/release/05-binary-upload.sh b/dev/release/05-binary-upload.sh
index 4dd4a50..5a30fc8 100755
--- a/dev/release/05-binary-upload.sh
+++ b/dev/release/05-binary-upload.sh
@@ -68,7 +68,6 @@ fi
 : ${UPLOAD_AMAZON_LINUX:=${UPLOAD_DEFAULT}}
 : ${UPLOAD_CENTOS:=${UPLOAD_DEFAULT}}
 : ${UPLOAD_DEBIAN:=${UPLOAD_DEFAULT}}
-: ${UPLOAD_JAVA:=${UPLOAD_DEFAULT}}
 : ${UPLOAD_NUGET:=${UPLOAD_DEFAULT}}
 : ${UPLOAD_PYTHON:=${UPLOAD_DEFAULT}}
 : ${UPLOAD_UBUNTU:=${UPLOAD_DEFAULT}}
@@ -92,9 +91,6 @@ if [ ${UPLOAD_DEBIAN} -gt 0 ]; then
   rake_tasks+=(apt:rc)
   apt_targets+=(debian)
 fi
-if [ ${UPLOAD_JAVA} -gt 0 ]; then
-  rake_tasks+=(java:rc)
-fi
 if [ ${UPLOAD_NUGET} -gt 0 ]; then
   rake_tasks+=(nuget:rc)
 fi
diff --git a/dev/release/06-java-upload.sh b/dev/release/06-java-upload.sh
new file mode 100755
index 0000000..5b27558
--- /dev/null
+++ b/dev/release/06-java-upload.sh
@@ -0,0 +1,140 @@
+#!/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.
+
+set -e
+set -u
+set -o pipefail
+
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+if [ "$#" -ne 2 ]; then
+  echo "Usage: $0 <version> <rc-num>"
+  exit
+fi
+
+version=$1
+rc=$2
+
+pushd "${SOURCE_DIR}"
+if [ ! -f .env ]; then
+  echo "You must create $(pwd)/.env"
+  echo "You can use $(pwd)/.env.example as template"
+  exit 1
+fi
+. .env
+popd
+
+version_with_rc="${version}-rc${rc}"
+crossbow_job_prefix="release-${version_with_rc}"
+crossbow_package_dir="${SOURCE_DIR}/../../packages"
+
+: ${CROSSBOW_JOB_NUMBER:="0"}
+: ${CROSSBOW_JOB_ID:="${crossbow_job_prefix}-${CROSSBOW_JOB_NUMBER}"}
+artifact_dir="${crossbow_package_dir}/${CROSSBOW_JOB_ID}"
+
+if [ ! -e "${artifact_dir}" ]; then
+  echo "${artifact_dir} does not exist"
+  exit 1
+fi
+
+if [ ! -d "${artifact_dir}" ]; then
+  echo "${artifact_dir} is not a directory"
+  exit 1
+fi
+
+cd "${artifact_dir}/java-jars"
+
+files=
+types=
+classifiers=
+
+sign() {
+  local path="$1"
+  local classifier="$2"
+  local type=$(echo "${path}" | grep -o "[^.]*$")
+
+  local asc_path="${path}.asc"
+  rm -f "${asc_path}"
+  gpg \
+    --detach-sig \
+    --local-user "${GPG_KEY_ID}" \
+    --output "${asc_path}" \
+    "${path}"
+  if [ -n "${files}" ]; then
+    files="${files},"
+    types="${types},"
+    classifiers="${classifiers},"
+  fi
+  files="${files}${asc_path}"
+  types="${types}${type}.asc"
+  classifiers="${classifiers}${classifier}"
+
+  # .md5 and .sha1 are generated automatically on repository side.
+  # local sha512_path="${path}.sha512"
+  # shasum --algorithm 512 "${path}" > "${sha512_path}"
+  # files="${files},${sha512_path}"
+  # types="${types},${type}.sha512"
+  # classifiers="${classifiers},${classifier}"
+}
+
+for pom in *.pom; do
+  base=$(basename ${pom} .pom)
+  args=()
+  args+=(deploy:deploy-file)
+  
args+=(-Durl=https://repository.apache.org/service/local/staging/deploy/maven2)
+  args+=(-DrepositoryId=apache.releases.https)
+  pom="${PWD}/${pom}"
+  args+=(-DpomFile="${pom}")
+  if [ -f "${base}.jar" ]; then
+    jar="${PWD}/${base}.jar"
+    args+=(-Dfile="${jar}")
+    sign "${jar}" ""
+  else
+    args+=(-Dfile="${pom}")
+  fi
+  sign "${pom}" ""
+  if [ "$(echo ${base}-*)" != "${base}-*" ]; then
+    for other_file in ${base}-*; do
+      file="${PWD}/${other_file}"
+      type=$(echo "${other_file}" | grep -o "[^.]*$")
+      case "${type}" in
+        asc|sha256|sha512)
+          continue
+          ;;
+      esac
+      classifier=$(basename "${other_file}" ".${type}" | sed -e 
"s/${base}-//g")
+      files="${files},${file}"
+      types="${types},${type}"
+      classifiers="${classifiers},${classifier}"
+      sign "${file}" "${classifier}"
+    done
+  fi
+  args+=(-Dfiles="${files}")
+  args+=(-Dtypes="${types}")
+  args+=(-Dclassifiers="${classifiers}")
+  pushd "${SOURCE_DIR}"
+  mvn deploy:deploy-file "${args[@]}"
+  popd
+done
+
+echo "Success!"
+echo "Press the 'Close' button manually by Web interface:"
+echo "    https://repository.apache.org/#stagingRepositories";
+echo "It publishes the artifacts to the staging repository:"
+echo "    
https://repository.apache.org/content/repositories/staging/org/apache/arrow/";
diff --git a/dev/release/binary-task.rb b/dev/release/binary-task.rb
index 10211d0..081fbee 100644
--- a/dev/release/binary-task.rb
+++ b/dev/release/binary-task.rb
@@ -739,7 +739,6 @@ class BinaryTask
   def define
     define_apt_tasks
     define_yum_tasks
-    define_java_tasks
     define_nuget_tasks
     define_python_tasks
     define_summary_tasks
@@ -1857,14 +1856,6 @@ APT::FTPArchive::Release::Description 
"#{apt_repository_description}";
     define_generic_data_release_tasks(label, id, release_dir)
   end
 
-  def define_java_tasks
-    define_generic_data_tasks("Java",
-                              :java,
-                              "#{rc_dir}/java/#{full_version}",
-                              "#{release_dir}/java/#{full_version}",
-                              "java-jars/**/*")
-  end
-
   def define_nuget_tasks
     define_generic_data_tasks("NuGet",
                               :nuget,
@@ -1893,7 +1884,6 @@ Success! The release candidate binaries are available 
here:
   https://apache.jfrog.io/artifactory/arrow/amazon-linux#{suffix}-rc/
   https://apache.jfrog.io/artifactory/arrow/centos#{suffix}-rc/
   https://apache.jfrog.io/artifactory/arrow/debian#{suffix}-rc/
-  https://apache.jfrog.io/artifactory/arrow/java#{suffix}-rc/#{version}
   https://apache.jfrog.io/artifactory/arrow/nuget#{suffix}-rc/#{full_version}
   https://apache.jfrog.io/artifactory/arrow/python#{suffix}-rc/#{full_version}
   https://apache.jfrog.io/artifactory/arrow/ubuntu#{suffix}-rc/
@@ -1910,7 +1900,6 @@ Success! The release binaries are available here:
   https://apache.jfrog.io/artifactory/arrow/amazon-linux#{suffix}/
   https://apache.jfrog.io/artifactory/arrow/centos#{suffix}/
   https://apache.jfrog.io/artifactory/arrow/debian#{suffix}/
-  https://apache.jfrog.io/artifactory/arrow/java#{suffix}/#{version}
   https://apache.jfrog.io/artifactory/arrow/nuget#{suffix}/#{version}
   https://apache.jfrog.io/artifactory/arrow/python#{suffix}/#{version}
   https://apache.jfrog.io/artifactory/arrow/ubuntu#{suffix}/
diff --git a/dev/release/download_rc_binaries.py 
b/dev/release/download_rc_binaries.py
index 1384d78..ebd66a2 100755
--- a/dev/release/download_rc_binaries.py
+++ b/dev/release/download_rc_binaries.py
@@ -25,27 +25,31 @@ import subprocess
 import urllib.request
 
 
-ARTIFACTORY_ROOT = "https://apache.jfrog.io/artifactory/arrow";
 DEFAULT_PARALLEL_DOWNLOADS = 8
 
 
-class Artifactory:
+class Downloader:
 
-    def get_file_list(self, prefix):
+    def get_file_list(self, prefix, filter=None):
         def traverse(directory, files, directories):
-            url = f'{ARTIFACTORY_ROOT}/{directory}'
+            url = f'{self.URL_ROOT}/{directory}'
             response = urllib.request.urlopen(url).read().decode()
             paths = re.findall('<a href="(.+?)"', response)
             for path in paths:
+                path = re.sub(f'^{re.escape(url)}',
+                              '',
+                              path)
                 if path == '../':
                     continue
                 resolved_path = f'{directory}{path}'
+                if filter and not filter(path):
+                    continue
                 if path.endswith('/'):
                     directories.append(resolved_path)
                 else:
                     files.append(resolved_path)
         files = []
-        if not prefix.endswith('/'):
+        if prefix != '' and not prefix.endswith('/'):
             prefix += '/'
         directories = [prefix]
         while len(directories) > 0:
@@ -98,7 +102,7 @@ class Artifactory:
 
         print("Downloading {} to {}".format(path, dest_path))
 
-        url = f'{ARTIFACTORY_ROOT}/{path}'
+        url = f'{self.URL_ROOT}/{path}'
 
         cmd = [
             'curl', '--fail', '--location', '--retry', '5',
@@ -112,6 +116,15 @@ class Artifactory:
                             .format(path, stdout, stderr))
 
 
+class Artifactory(Downloader):
+    URL_ROOT = "https://apache.jfrog.io/artifactory/arrow";
+
+
+class Maven(Downloader):
+    URL_ROOT = "https://repository.apache.org"; + \
+        "/content/repositories/staging/org/apache/arrow"
+
+
 def parallel_map_terminate_early(f, iterable, num_parallel):
     tasks = []
     with cf.ProcessPoolExecutor(num_parallel) as pool:
@@ -133,7 +146,7 @@ ARROW_REPOSITORY_PACKAGE_TYPES = [
     'debian',
     'ubuntu',
 ]
-ARROW_STANDALONE_PACKAGE_TYPES = ['java', 'nuget', 'python']
+ARROW_STANDALONE_PACKAGE_TYPES = ['nuget', 'python']
 ARROW_PACKAGE_TYPES = \
     ARROW_REPOSITORY_PACKAGE_TYPES + \
     ARROW_STANDALONE_PACKAGE_TYPES
@@ -141,30 +154,33 @@ ARROW_PACKAGE_TYPES = \
 
 def download_rc_binaries(version, rc_number, re_match=None, dest=None,
                          num_parallel=None, target_package_type=None):
-    artifactory = Artifactory()
-
     version_string = '{}-rc{}'.format(version, rc_number)
+    version_pattern = re.compile(r'\d+\.\d+\.\d+')
     if target_package_type:
         package_types = [target_package_type]
     else:
         package_types = ARROW_PACKAGE_TYPES
     for package_type in package_types:
-        if package_type in ARROW_REPOSITORY_PACKAGE_TYPES:
+        def is_target(path):
+            match = version_pattern.search(path)
+            if not match:
+                return True
+            return match[0] == version
+        filter = is_target
+
+        if package_type == 'jars':
+            downloader = Maven()
+            prefix = ''
+        elif package_type in ARROW_REPOSITORY_PACKAGE_TYPES:
+            downloader = Artifactory()
             prefix = f'{package_type}-rc'
         else:
+            downloader = Artifactory()
             prefix = f'{package_type}-rc/{version_string}'
-        files = artifactory.get_file_list(prefix)
-        if package_type in ARROW_REPOSITORY_PACKAGE_TYPES:
-            version_pattern = re.compile(r'\d+\.\d+\.\d+')
-
-            def is_old_release(path):
-                match = version_pattern.search(path)
-                if not match:
-                    return False
-                return match[0] != version
-            files = [x for x in files if not is_old_release(x)]
-        artifactory.download_files(files, re_match=re_match, dest=dest,
-                                   num_parallel=num_parallel)
+            filter = None
+        files = downloader.get_file_list(prefix, filter=filter)
+        downloader.download_files(files, re_match=re_match, dest=dest,
+                                  num_parallel=num_parallel)
 
 
 if __name__ == '__main__':
diff --git a/dev/release/post-03-binary.sh b/dev/release/post-03-binary.sh
index d2a5b01..b1b41f9 100755
--- a/dev/release/post-03-binary.sh
+++ b/dev/release/post-03-binary.sh
@@ -49,7 +49,6 @@ fi
 : ${DEPLOY_AMAZON_LINUX:=${DEPLOY_DEFAULT}}
 : ${DEPLOY_CENTOS:=${DEPLOY_DEFAULT}}
 : ${DEPLOY_DEBIAN:=${DEPLOY_DEFAULT}}
-: ${DEPLOY_JAVA:=${DEPLOY_DEFAULT}}
 : ${DEPLOY_NUGET:=${DEPLOY_DEFAULT}}
 : ${DEPLOY_PYTHON:=${DEPLOY_DEFAULT}}
 : ${DEPLOY_UBUNTU:=${DEPLOY_DEFAULT}}
@@ -73,9 +72,6 @@ if [ ${DEPLOY_DEBIAN} -gt 0 ]; then
   rake_tasks+=(apt:release)
   apt_targets+=(debian)
 fi
-if [ ${DEPLOY_JAVA} -gt 0 ]; then
-  rake_tasks+=(java:release)
-fi
 if [ ${DEPLOY_NUGET} -gt 0 ]; then
   rake_tasks+=(nuget:release)
 fi
diff --git a/dev/release/post-13-go.sh b/dev/release/post-11-go.sh
similarity index 100%
rename from dev/release/post-13-go.sh
rename to dev/release/post-11-go.sh
diff --git a/dev/release/post-11-java.sh b/dev/release/post-11-java.sh
deleted file mode 100755
index 86e6e9b..0000000
--- a/dev/release/post-11-java.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/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.
-
-set -e
-set -o pipefail
-
-SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-if [ "$#" -ne 1 ]; then
-  echo "Usage: $0 <version>"
-  exit
-fi
-
-version=$1
-archive_name=apache-arrow-${version}
-tar_gz=${archive_name}.tar.gz
-
-rm -f ${tar_gz}
-curl \
-  --remote-name \
-  --fail \
-  https://downloads.apache.org/arrow/arrow-${version}/${tar_gz}
-rm -rf ${archive_name}
-tar xf ${tar_gz}
-
-pushd ${archive_name}
-
-# clone the testing data to the appropiate directories
-git clone https://github.com/apache/arrow-testing.git testing
-git clone https://github.com/apache/parquet-testing.git 
cpp/submodules/parquet-testing
-
-# build the jni bindings similarly like the 01-perform.sh does
-mkdir -p cpp/java-build
-pushd cpp/java-build
-cmake \
-  -DARROW_DATASET=ON \
-  -DARROW_FILESYSTEM=ON \
-  -DARROW_GANDIVA_JAVA=ON \
-  -DARROW_GANDIVA=ON \
-  -DARROW_JNI=ON \
-  -DARROW_ORC=ON \
-  -DARROW_PARQUET=ON \
-  -DCMAKE_BUILD_TYPE=release \
-  -G Ninja \
-  ..
-ninja
-popd
-
-# go in the java subfolder
-pushd java
-# stage the artifacts using both the apache-release and arrow-jni profiles
-# Note: on ORC checkstyle failure use -Dcheckstyle.skip=true until 
https://issues.apache.org/jira/browse/ARROW-12552 gets resolved
-mvn -Papache-release,arrow-jni -Darrow.cpp.build.dir=$(realpath 
../cpp/java-build/release) deploy
-popd
-
-popd
-
-echo "Success! The maven artifacts have been stated. Proceed with the 
following steps:"
-echo "1. Login to the apache repository: 
https://repository.apache.org/#stagingRepositories";
-echo "2. Select the arrow staging repository you just just created: 
orgapachearrow-100x"
-echo "3. Click the \"close\" button"
-echo "4. Once validation has passed, click the \"release\" button"
-echo ""
-echo "Note, that you must set up Maven to be able to publish to Apache's 
repositories."
-echo "Read more at https://www.apache.org/dev/publishing-maven-artifacts.html.";
diff --git a/dev/release/verify-release-candidate.sh 
b/dev/release/verify-release-candidate.sh
index 0f697fa..315258c 100755
--- a/dev/release/verify-release-candidate.sh
+++ b/dev/release/verify-release-candidate.sh
@@ -38,14 +38,14 @@ case $# in
      VERSION="$2"
      RC_NUMBER="$3"
      case $ARTIFACT in
-       source|binaries|wheels) ;;
+       source|binaries|wheels|jars) ;;
        *) echo "Invalid argument: '${ARTIFACT}', valid options are \
-'source', 'binaries', or 'wheels'"
+'source', 'binaries', 'wheels', or 'jars'"
           exit 1
           ;;
      esac
      ;;
-  *) echo "Usage: $0 source|binaries X.Y.Z RC_NUMBER"
+  *) echo "Usage: $0 source|binaries|wheels|jars X.Y.Z RC_NUMBER"
      exit 1
      ;;
 esac
@@ -127,7 +127,9 @@ verify_dir_artifact_signatures() {
     if [ -f $base_artifact.sha256 ]; then
       ${sha256_verify} $base_artifact.sha256 || exit 1
     fi
-    ${sha512_verify} $base_artifact.sha512 || exit 1
+    if [ -f $base_artifact.sha512 ]; then
+      ${sha512_verify} $base_artifact.sha512 || exit 1
+    fi
     popd
   done
 }
@@ -729,6 +731,17 @@ test_wheels() {
   popd
 }
 
+test_jars() {
+  local download_dir=jars
+  mkdir -p ${download_dir}
+
+  ${PYTHON:-python} $SOURCE_DIR/download_rc_binaries.py $VERSION $RC_NUMBER \
+         --dest=${download_dir} \
+         --package_type=jars
+
+  verify_dir_artifact_signatures ${download_dir}
+}
+
 # By default test all functionalities.
 # To deactivate one test, deactivate the test and all of its dependents
 # To explicitly select one test, set TEST_DEFAULT=0 TEST_X=1
@@ -737,16 +750,24 @@ test_wheels() {
 # system Node installation, which may be too old.
 : ${INSTALL_NODE:=1}
 
-if [ "${ARTIFACT}" == "source" ]; then
-  : ${TEST_SOURCE:=1}
-elif [ "${ARTIFACT}" == "wheels" ]; then
-  TEST_WHEELS=1
-else
-  TEST_BINARY_DISTRIBUTIONS=1
-fi
+case "${ARTIFACT}" in
+  source)
+    : ${TEST_SOURCE:=1}
+    ;;
+  binaires)
+    TEST_BINARY_DISTRIBUTIONS=1
+    ;;
+  wheels)
+    TEST_WHEELS=1
+    ;;
+  jars)
+    TEST_JARS=1
+    ;;
+esac
 : ${TEST_SOURCE:=0}
-: ${TEST_WHEELS:=0}
 : ${TEST_BINARY_DISTRIBUTIONS:=0}
+: ${TEST_WHEELS:=0}
+: ${TEST_JARS:=0}
 
 : ${TEST_DEFAULT:=1}
 : ${TEST_JAVA:=${TEST_DEFAULT}}
@@ -781,17 +802,28 @@ TEST_JS=$((${TEST_JS} + ${TEST_INTEGRATION_JS}))
 TEST_GO=$((${TEST_GO} + ${TEST_INTEGRATION_GO}))
 TEST_INTEGRATION=$((${TEST_INTEGRATION} + ${TEST_INTEGRATION_CPP} + 
${TEST_INTEGRATION_JAVA} + ${TEST_INTEGRATION_JS} + ${TEST_INTEGRATION_GO}))
 
-if [ "${ARTIFACT}" == "source" ]; then
-  NEED_MINICONDA=$((${TEST_CPP} + ${TEST_INTEGRATION}))
-elif [ "${ARTIFACT}" == "wheels" ]; then
-  NEED_MINICONDA=$((${TEST_WHEELS}))
-else
-  if [ -z "${PYTHON:-}" ]; then
-    NEED_MINICONDA=$((${TEST_BINARY}))
-  else
-    NEED_MINICONDA=0
-  fi
-fi
+case "${ARTIFACT}" in
+  source)
+    NEED_MINICONDA=$((${TEST_CPP} + ${TEST_INTEGRATION}))
+    ;;
+  binaries)
+    if [ -z "${PYTHON:-}" ]; then
+      NEED_MINICONDA=$((${TEST_BINARY}))
+    else
+      NEED_MINICONDA=0
+    fi
+    ;;
+  wheels)
+    NEED_MINICONDA=$((${TEST_WHEELS}))
+    ;;
+  jars)
+    if [ -z "${PYTHON:-}" ]; then
+      NEED_MINICONDA=1
+    else
+      NEED_MINICONDA=0
+    fi
+    ;;
+esac
 
 : ${TEST_ARCHIVE:=apache-arrow-${VERSION}.tar.gz}
 case "${TEST_ARCHIVE}" in
@@ -812,32 +844,40 @@ if [ ${NEED_MINICONDA} -gt 0 ]; then
   setup_miniconda
 fi
 
-if [ "${ARTIFACT}" == "source" ]; then
-  dist_name="apache-arrow-${VERSION}"
-  if [ ${TEST_SOURCE} -gt 0 ]; then
-    import_gpg_keys
-    if [ ! -d "${dist_name}" ]; then
-      fetch_archive ${dist_name}
-      tar xf ${dist_name}.tar.gz
-    fi
-  else
-    mkdir -p ${dist_name}
-    if [ ! -f ${TEST_ARCHIVE} ]; then
-      echo "${TEST_ARCHIVE} not found"
-      exit 1
+case "${ARTIFACT}" in
+  source)
+    dist_name="apache-arrow-${VERSION}"
+    if [ ${TEST_SOURCE} -gt 0 ]; then
+      import_gpg_keys
+      if [ ! -d "${dist_name}" ]; then
+        fetch_archive ${dist_name}
+        tar xf ${dist_name}.tar.gz
+      fi
+    else
+      mkdir -p ${dist_name}
+      if [ ! -f ${TEST_ARCHIVE} ]; then
+        echo "${TEST_ARCHIVE} not found"
+        exit 1
+      fi
+      tar xf ${TEST_ARCHIVE} -C ${dist_name} --strip-components=1
     fi
-    tar xf ${TEST_ARCHIVE} -C ${dist_name} --strip-components=1
-  fi
-  pushd ${dist_name}
-  test_source_distribution
-  popd
-elif [ "${ARTIFACT}" == "wheels" ]; then
-  import_gpg_keys
-  test_wheels
-else
-  import_gpg_keys
-  test_binary_distribution
-fi
+    pushd ${dist_name}
+    test_source_distribution
+    popd
+    ;;
+  binaries)
+    import_gpg_keys
+    test_binary_distribution
+    ;;
+  wheels)
+    import_gpg_keys
+    test_wheels
+    ;;
+  jars)
+    import_gpg_keys
+    test_jars
+    ;;
+esac
 
 TEST_SUCCESS=yes
 echo 'Release candidate looks good!'
diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml
index 5e7b84b..8248143 100644
--- a/dev/tasks/tasks.yml
+++ b/dev/tasks/tasks.yml
@@ -113,6 +113,9 @@ groups:
   verify-rc-binaries:
     - verify-rc-binaries-*
 
+  verify-rc-jars:
+    - verify-rc-jars-*
+
   verify-rc-wheels:
     - verify-rc-wheels-*
 
@@ -829,9 +832,18 @@ tasks:
       env:
         TEST_DEFAULT: 0
         TEST_{{ target|upper }}: 1
-      artifact: {{ target }}
+      artifact: binaries
 {% endfor %}
 
+  verify-rc-jars-amd64:
+    ci: github
+    template: verify-rc/github.linux.amd64.yml
+    params:
+      env:
+        TEST_DEFAULT: 0
+        TEST_JARS: 1
+      artifact: jars
+
 {% for platform, arch, runner in [("linux", "amd64", "ubuntu-20.04"),
                                   ("macos", "amd64", "macos-10.15")] %}
   {% for target in ["cpp",

Reply via email to