This is an automated email from the ASF dual-hosted git repository.
slawekjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
The following commit(s) were added to refs/heads/master by this push:
new 9b086982 Add option to stage release candidates in ATR
9b086982 is described below
commit 9b08698232d5ffd2b03066fa468b7abd59ab869b
Author: Slawomir Jaranowski <[email protected]>
AuthorDate: Mon Nov 23 23:41:25 2026 +0100
Add option to stage release candidates in ATR
Add build/release-candidate-atr.sh as an alternative to
release-candidate.sh. It checks that the version exists in ATR in the
composing phase (atr:check-composing), downloads the GitHub release
assets, computes checksums and signatures and uploads them to ATR
(atr:upload) instead of committing them to dist/dev.
Configure atr-maven-plugin with the ATR project key maven-mvnd, as the
root artifactId (mvnd), used by default, does not match
https://releases.apache.org/projects/maven-mvnd.
release-publish.sh now moves the release from dist/dev to dist/release
only when the release candidate was staged in dist/dev. For a release
candidate staged in ATR, the release is published to dist/release by
finishing the release process in ATR, so the script only checks that it
is already there.
Document the ATR release process in RELEASING.adoc.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
RELEASING.adoc | 19 +++++++++
build/release-candidate-atr.sh | 89 ++++++++++++++++++++++++++++++++++++++++++
build/release-publish.sh | 22 +++++++++--
pom.xml | 8 ++++
4 files changed, 135 insertions(+), 3 deletions(-)
diff --git a/RELEASING.adoc b/RELEASING.adoc
index d284baef..faabde7c 100644
--- a/RELEASING.adoc
+++ b/RELEASING.adoc
@@ -22,3 +22,22 @@ You can now call a vote on the
mailto:[email protected][dev mailing list] poi
./build/release-publish.sh <released-version>
----
WARNING: *TODO*: document the publication process (move to the final svn area,
homebrew, sdkman, choco updates...)
+
+== Release using ATR
+
+Instead of the https://dist.apache.org/repos/dist/dev/maven/mvnd/[dev
distribution repository], the release candidate can be staged in
https://releases.apache.org/projects/maven-mvnd[ATR].
+The steps differ from the ones above as follows:
+
+* The version must already exist in ATR in the composing phase.
+ATR credentials are read from the `apache.atr` server in `settings.xml`: the
username is the ASF user ID and the password is the ATR Personal Access Token.
+
+* Instead of `release-candidate.sh`, run the
https://raw.githubusercontent.com/apache/maven-mvnd/master/build/release-candidate-atr.sh[release-candidate-atr
script], which checks the version in ATR, downloads the built assemblies,
computes the checksums and signatures and uploads them to ATR.
+[source,shell]
+----
+./build/release-candidate-atr.sh <released-version>
+----
+
+* Start the vote in ATR, using *Start voting* on the project page, instead of
calling it manually on the dev mailing list.
+
+* Once the vote passes, finish the release process in ATR, which publishes the
release to the https://dist.apache.org/repos/dist/release/maven/mvnd/[release
distribution repository].
+Then run `release-publish.sh` as usual. It detects that the release candidate
is not in the dev distribution repository, so it does not move anything in svn,
it only checks that the release is already published and fails otherwise.
diff --git a/build/release-candidate-atr.sh b/build/release-candidate-atr.sh
new file mode 100755
index 00000000..5b5a27a1
--- /dev/null
+++ b/build/release-candidate-atr.sh
@@ -0,0 +1,89 @@
+#!/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.
+#
+
+#
+# Prepare a release candidate and upload it to ATR
(https://releases.apache.org/projects/maven-mvnd)
+# instead of committing it to
https://dist.apache.org/repos/dist/dev/maven/mvnd (see release-candidate.sh).
+#
+# Usage: build/release-candidate-atr.sh <version> [additional maven options,
e.g. -Datr.dryRun=true]
+#
+# Must be run from the root of the project.
+# ATR credentials are read from the "apache.atr" server in settings.xml:
+# username is the ASF user ID, password is the ATR Personal Access Token.
+#
+
+# Enable for debug execution
+# set -x
+
+set -e
+export VERSION=$1
+
+if [ "${VERSION}x" = "x" ]
+then
+ echo "Specify the version: $0 <version> [maven options]"
+ exit 1
+fi
+shift
+
+if [ ! -f pom.xml ] || [ ! -d build ]
+then
+ echo "Run this script from the root of the project"
+ exit 1
+fi
+
+RELEASE_DIR="$(pwd)/target/releases/mvnd/${VERSION}"
+
+# version in ATR, for tests use a version with a suffix, e.g.:
+# ATR_VERSION="${VERSION}-test"
+ATR_VERSION="${VERSION}"
+
+# fail early if the version does not exist in ATR or is not in the composing
phase
+./mvnw --non-recursive atr:check-composing \
+ -Datr.version="${ATR_VERSION}" \
+ "$@"
+
+rm -Rf "${RELEASE_DIR}"
+mkdir -p "${RELEASE_DIR}"
+pushd "${RELEASE_DIR}"
+
+gh release download "${VERSION}"
+
+for dist in maven-mvnd*.*
+do
+ echo "Processing ${dist}"
+ # sha256 are used by homebrew which does not support sha512 atm
+ shasum -a 256 -b "${dist}" | cut -d ' ' -f 1 > "${dist}.sha256"
+ shasum -a 512 -b "${dist}" | cut -d ' ' -f 1 > "${dist}.sha512"
+ gpg --detach-sign --armor "${dist}"
+done
+
+# comma separated list of absolute paths of all files to upload
+FILES=$(find "${RELEASE_DIR}" -maxdepth 1 -type f -name 'maven-mvnd*' | sort |
paste -sd ',' -)
+
+popd
+
+./mvnw --non-recursive atr:upload \
+ -Datr.version="${ATR_VERSION}" \
+ -Datr.files="${FILES}" \
+ "$@"
+
+echo
+echo "Release candidate ${ATR_VERSION} uploaded to ATR."
+echo "Start the vote in ATR using 'Start voting' on
https://releases.apache.org/compose/maven-mvnd/${ATR_VERSION}"
diff --git a/build/release-publish.sh b/build/release-publish.sh
index ba93544b..b2f3797d 100755
--- a/build/release-publish.sh
+++ b/build/release-publish.sh
@@ -28,9 +28,25 @@ then
exit 1
fi
-svn move -m "Release Apache Maven Daemon ${VERSION}" \
- https://dist.apache.org/repos/dist/dev/maven/mvnd/${VERSION} \
- https://dist.apache.org/repos/dist/release/maven/mvnd/
+DIST_DEV_URL="https://dist.apache.org/repos/dist/dev/maven/mvnd/${VERSION}"
+DIST_RELEASE_URL="https://dist.apache.org/repos/dist/release/maven/mvnd/${VERSION}"
+
+if svn info "${DIST_DEV_URL}" > /dev/null 2>&1
+then
+ # release candidate was staged in dist/dev by release-candidate.sh
+ svn move -m "Release Apache Maven Daemon ${VERSION}" \
+ "${DIST_DEV_URL}" \
+ https://dist.apache.org/repos/dist/release/maven/mvnd/
+elif svn info "${DIST_RELEASE_URL}" > /dev/null 2>&1
+then
+ # release candidate was staged in ATR by release-candidate-atr.sh,
+ # ATR has already published it to dist/release
+ echo "${VERSION} not found in dist/dev, but already in dist/release
(released by ATR), skipping svn move"
+else
+ echo "${VERSION} not found in ${DIST_DEV_URL} nor in ${DIST_RELEASE_URL}"
+ echo "If the release candidate was staged in ATR, finish the release on
https://releases.apache.org/projects/maven-mvnd first"
+ exit 1
+fi
./build/publish-on-homebrew.sh ${VERSION}
./build/publish-on-sdkman.sh ${VERSION}
diff --git a/pom.xml b/pom.xml
index 3173fec7..79bb507c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -540,6 +540,14 @@
<tagNameFormat>@{project.version}</tagNameFormat>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.tooling</groupId>
+ <artifactId>atr-maven-plugin</artifactId>
+ <configuration>
+ <!-- project key on
https://releases.apache.org/projects/maven-mvnd differs from the artifactId -->
+ <project>maven-mvnd</project>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-wrapper-plugin</artifactId>