Skip to content

Commit 4122ff2

Browse files
kszucsandygrove
andcommitted
ARROW-6103: [Release][Java] Remove mvn release plugin
We want to stop using the maven release plugin because it commits to the repo both in the `prepare` and `perform` tasks and adds complexity to the release process. This PR removes the plugin and updates the release preparation script to use the maven versions plugin to update the version number in the pom files. We will need to run `mvn deploy` to publish the artifacts and I'm not sure where that needs to happen (`mvn release:perform` was previously invoking the `deploy` phase). Closes #9155 from andygrove/remove-mvn-release-plugin Lead-authored-by: Krisztián Szűcs <[email protected]> Co-authored-by: Andy Grove <[email protected]> Signed-off-by: Krisztián Szűcs <[email protected]>
1 parent b0c968c commit 4122ff2

File tree

6 files changed

+177
-71
lines changed

6 files changed

+177
-71
lines changed

dev/release/00-prepare-test.rb renamed to dev/release/01-prepare-test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def setup
3131
Dir.chdir(@test_git_repository) do
3232
@tag_name = "apache-arrow-#{@release_version}"
3333
@release_branch = "release-#{@release_version}-rc0"
34-
@script = "dev/release/00-prepare.sh"
34+
@script = "dev/release/01-prepare.sh"
3535
git("checkout", "-b", @release_branch, @current_commit)
3636
yield
3737
end
@@ -54,7 +54,7 @@ def prepare(*targets)
5454
env["PREPARE_#{target}"] = "1"
5555
end
5656
env = env.merge(additional_env)
57-
sh(env, @script, @release_version, @next_version)
57+
sh(env, @script, @release_version, @next_version, "0")
5858
end
5959

6060
def parse_patch(patch)

dev/release/00-prepare.sh renamed to dev/release/01-prepare.sh

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ set -ue
2121

2222
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2323

24-
if [ "$#" -ne 2 ]; then
25-
echo "Usage: $0 <version> <next_version>"
24+
if [ "$#" -ne 3 ]; then
25+
echo "Usage: $0 <version> <next_version> <rc-num>"
2626
exit 1
2727
fi
2828

@@ -172,17 +172,47 @@ update_versions() {
172172

173173
version=$1
174174
next_version=$2
175-
next_version_snapshot=${next_version}-SNAPSHOT
176-
tag=apache-arrow-${version}
175+
next_version_snapshot="${next_version}-SNAPSHOT"
176+
rc_number=$3
177+
178+
release_tag="apache-arrow-${version}"
179+
release_branch="release-${version}"
180+
release_candidate_branch="release-${version}-rc${rc_number}"
177181

178182
: ${PREPARE_DEFAULT:=1}
179183
: ${PREPARE_CHANGELOG:=${PREPARE_DEFAULT}}
180184
: ${PREPARE_LINUX_PACKAGES:=${PREPARE_DEFAULT}}
181185
: ${PREPARE_VERSION_PRE_TAG:=${PREPARE_DEFAULT}}
186+
: ${PREPARE_BRANCH:=${PREPARE_DEFAULT}}
182187
: ${PREPARE_TAG:=${PREPARE_DEFAULT}}
183188
: ${PREPARE_VERSION_POST_TAG:=${PREPARE_DEFAULT}}
184189
: ${PREPARE_DEB_PACKAGE_NAMES:=${PREPARE_DEFAULT}}
185190

191+
if [ ${PREPARE_TAG} -gt 0 ]; then
192+
if [ $(git tag -l "${release_tag}") ]; then
193+
echo "Delete existing git tag $release_tag"
194+
git tag -d "${release_tag}"
195+
fi
196+
fi
197+
198+
if [ ${PREPARE_BRANCH} -gt 0 ]; then
199+
if [[ $(git branch -l "${release_candidate_branch}") ]]; then
200+
next_rc_number=$(($rc_number+1))
201+
echo "Branch ${release_candidate_branch} already exists, so create a new release candidate:"
202+
echo "1. Checkout the master branch for major releases and maint-<version> for patch releases."
203+
echo "2. Execute the script again with bumped RC number."
204+
echo "Commands:"
205+
echo " git checkout master"
206+
echo " dev/release/01-prepare.sh ${version} ${next_version} ${next_rc_number}"
207+
exit 1
208+
fi
209+
210+
echo "Create local branch ${release_candidate_branch} for release candidate ${rc_number}"
211+
git checkout -b ${release_candidate_branch}
212+
fi
213+
214+
############################## Pre-Tag Commits ##############################
215+
186216
if [ ${PREPARE_CHANGELOG} -gt 0 ]; then
187217
echo "Updating changelog for $version"
188218
# Update changelog
@@ -204,40 +234,16 @@ if [ ${PREPARE_LINUX_PACKAGES} -gt 0 ]; then
204234
fi
205235

206236
if [ ${PREPARE_VERSION_PRE_TAG} -gt 0 ]; then
207-
echo "prepare release ${version} on tag ${tag} then reset to version ${next_version_snapshot}"
237+
echo "Prepare release ${version} on tag ${release_tag} then reset to version ${next_version_snapshot}"
208238

209239
update_versions "${version}" "${next_version}" "release"
210240
git commit -m "[Release] Update versions for ${version}"
211241
fi
212242

243+
############################## Tag the Release ##############################
244+
213245
if [ ${PREPARE_TAG} -gt 0 ]; then
214-
profile=arrow-jni # this includes components which depend on arrow cpp.
215-
pushd "${SOURCE_DIR}/../../java"
216-
git submodule update --init --recursive
217-
cpp_dir="${PWD}/../cpp"
218-
cpp_build_dir=$(mktemp -d -t "apache-arrow-cpp.XXXXX")
219-
pushd ${cpp_build_dir}
220-
cmake \
221-
-DARROW_GANDIVA=ON \
222-
-DARROW_GANDIVA_JAVA=ON \
223-
-DARROW_JNI=ON \
224-
-DARROW_ORC=ON \
225-
-DCMAKE_BUILD_TYPE=release \
226-
-G Ninja \
227-
"${cpp_dir}"
228-
ninja
229-
popd
230-
mvn release:clean
231-
mvn \
232-
release:prepare \
233-
-Darguments=-Darrow.cpp.build.dir=${cpp_build_dir}/release \
234-
-DautoVersionSubmodules \
235-
-DdevelopmentVersion=${next_version_snapshot} \
236-
-DreleaseVersion=${version} \
237-
-Dtag=${tag} \
238-
-P ${profile}
239-
rm -rf ${cpp_build_dir}
240-
popd
246+
git tag -a "${release_tag}" -m "[Release] Apache Arrow Release ${version}"
241247
fi
242248

243249
############################## Post-Tag Commits #############################
@@ -283,5 +289,3 @@ if [ ${PREPARE_DEB_PACKAGE_NAMES} -gt 0 ]; then
283289
cd -
284290
fi
285291
fi
286-
287-
echo "Finish staging binary artifacts by running: dev/release/01-perform.sh"

dev/release/03-binary-submit.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
set -e
21+
22+
if [ "$#" -ne 2 ]; then
23+
echo "Usage: $0 <version> <rc-num>"
24+
exit
25+
fi
26+
27+
version=$1
28+
rc_number=$2
29+
version_with_rc="${version}-rc${rc_number}"
30+
crossbow_job_prefix="release-${version_with_rc}"
31+
32+
release_tag="apache-arrow-${version}"
33+
release_candidate_branch="release-${version}-rc${rc_number}"
34+
35+
: ${GIT_REMOTE:="origin"}
36+
37+
git checkout ${release_candidate_branch}
38+
git push -u ${GIT_REMOTE} ${release_candidate_branch}
39+
40+
# archery will submit a job with id: "${crossbow_job_prefix}-0" unless there
41+
# are jobs submitted with the same prefix (the integer at the end is auto
42+
# incremented)
43+
archery crossbow submit \
44+
--job-prefix ${crossbow_job_prefix} \
45+
--arrow-version ${version_with_rc} \
46+
--group packaging

dev/release/01-perform.sh renamed to dev/release/04-binary-download.sh

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,22 @@
1717
# specific language governing permissions and limitations
1818
# under the License.
1919
#
20-
set -e
21-
22-
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2320

24-
pushd "${SOURCE_DIR}/../../java"
25-
git submodule update --init --recursive
21+
set -e
2622

27-
profile=arrow-jni # this includes components which depend on arrow cpp.
23+
if [ "$#" -ne 2 ]; then
24+
echo "Usage: $0 <version> <rc-num>"
25+
exit
26+
fi
2827

29-
cpp_dir="${PWD}/../cpp"
30-
cpp_build_dir=$(mktemp -d -t "apache-arrow-cpp.XXXXX")
31-
pushd ${cpp_build_dir}
32-
cmake \
33-
-DARROW_GANDIVA=ON \
34-
-DARROW_GANDIVA_JAVA=ON \
35-
-DARROW_JNI=ON \
36-
-DARROW_ORC=ON \
37-
-DCMAKE_BUILD_TYPE=release \
38-
-G Ninja \
39-
"${cpp_dir}"
40-
ninja
41-
popd
28+
version=$1
29+
rc_number=$2
30+
version_with_rc="${version}-rc${rc_number}"
31+
crossbow_job_prefix="release-${version_with_rc}"
4232

43-
export ARROW_TEST_DATA=${PWD}/../testing/data
44-
mvn \
45-
release:perform \
46-
-Darguments=-Darrow.cpp.build.dir=${cpp_build_dir}/release \
47-
-P ${profile}
48-
rm -rf ${cpp_build_dir}
33+
# archery will submit a job with id: "${crossbow_job_prefix}-0" unless there
34+
# are jobs submitted with the same prefix (the integer at the end is auto
35+
# incremented)
36+
: ${CROSSBOW_JOB_ID:="${crossbow_job_prefix}-0"}
4937

50-
popd
38+
archery crossbow download-artifacts ${CROSSBOW_JOB_ID}

dev/release/03-binary.sh renamed to dev/release/05-binary-upload.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,20 @@ set -o pipefail
2323

2424
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2525

26-
if [ "$#" -ne 3 ]; then
27-
echo "Usage: $0 <version> <rc-num> <artifact-dir>"
26+
if [ "$#" -ne 2 ]; then
27+
echo "Usage: $0 <version> <rc-num>"
2828
exit
2929
fi
3030

3131
version=$1
3232
rc=$2
33-
artifact_dir=$3
3433

35-
if [ -z "$artifact_dir" ]; then
36-
echo "artifact_dir is empty"
37-
exit 1
38-
fi
34+
version_with_rc="${version}-rc${rc}"
35+
crossbow_job_prefix="release-${version_with_rc}"
36+
crossbow_package_dir="${SOURCE_DIR}/../../packages"
37+
38+
: ${CROSSBOW_JOB_ID:="${crossbow_job_prefix}-0"}
39+
artifact_dir="${crossbow_package_dir}/${CROSSBOW_JOB_ID}"
3940

4041
if [ ! -e "$artifact_dir" ]; then
4142
echo "$artifact_dir does not exist"
@@ -47,8 +48,6 @@ if [ ! -d "$artifact_dir" ]; then
4748
exit 1
4849
fi
4950

50-
artifact_dir="$(pwd)/${artifact_dir}"
51-
5251
cd "${SOURCE_DIR}"
5352

5453
: ${BINTRAY_REPOSITORY_CUSTOM:=${BINTRAY_REPOSITORY:-}}

dev/release/post-11-java.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
set -e
21+
set -o pipefail
22+
23+
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
24+
25+
if [ "$#" -ne 1 ]; then
26+
echo "Usage: $0 <version>"
27+
exit
28+
fi
29+
30+
version=$1
31+
archive_name=apache-arrow-${version}
32+
tar_gz=${archive_name}.tar.gz
33+
34+
rm -f ${tar_gz}
35+
curl \
36+
--remote-name \
37+
--fail \
38+
https://downloads.apache.org/arrow/arrow-${version}/${tar_gz}
39+
rm -rf ${archive_name}
40+
tar xf ${tar_gz}
41+
42+
# build the jni bindings similarly like the 01-perform.sh does
43+
mkdir -p ${archive_name}/cpp/java-build
44+
pushd ${archive_name}/cpp/java-build
45+
cmake \
46+
-DARROW_GANDIVA=ON \
47+
-DARROW_GANDIVA_JAVA=ON \
48+
-DARROW_JNI=ON \
49+
-DARROW_ORC=ON \
50+
-DCMAKE_BUILD_TYPE=release \
51+
-G Ninja \
52+
..
53+
ninja
54+
popd
55+
56+
# go in the java subfolder
57+
pushd ${archive_name}/java
58+
# stage the artifacts using both the apache-release and arrow-jni profiles
59+
mvn -Papache-release,arrow-jni -Darrow.cpp.build.dir=$(realpath ../cpp/java-build) deploy
60+
popd
61+
62+
echo "Success! The maven artifacts have been stated. Proceed with the following steps:"
63+
echo "1. Login to the apache repository: https://repository.apache.org/#stagingRepositories"
64+
echo "2. Select the arrow staging repository you just just created: orgapachearrow-100x"
65+
echo "3. Click the \"close\" button"
66+
echo "4. Once validation has passed, click the \"release\" button"
67+
echo ""
68+
echo "Note, that you must set up Maven to be able to publish to Apache's repositories."
69+
echo "Read more at https://www.apache.org/dev/publishing-maven-artifacts.html."

0 commit comments

Comments
 (0)