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

dashorst pushed a commit to branch wicket-8.x
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit 69e81a4d53c02bee4bc992941498cd63fc1972d5
Author: Martijn Dashorst <[email protected]>
AuthorDate: Mon Oct 26 16:28:22 2026 +0100

    Fix the release script failures found while releasing 9.25.0
    
    build-versions.py gave every module the release and development version
    of Wicket itself, so the experimental modules, which have a version line
    of their own (wicket-http2 0.26-SNAPSHOT, wicket-metrics 0.27-SNAPSHOT),
    would have been released as 8.20.0. A module with a version of its own
    is now released at that version without -SNAPSHOT and continues on the
    next one; a module that shares the project version keeps getting the
    versions from the command line.
    
    release.sh:
    
    - The staging repository id came out empty: grep -E does not support
      \d, and grep -v "OPEN" kept the wrong repositories. It now takes the
      orgapachewicket- repository that isn't closed, with its full id.
    - Maven 3.9 uploads in parallel, which can split a release over several
      staging repositories. Uploads are sequential now, as on 9.x.
    - The tag signing passed the escaped quotes of its message to git as
      literal characters, failed with "too many arguments" and left the
      release tag unsigned. The quotes are plain now, and a failure stops
      the script.
    - gpg problems surfaced only in release:perform, after release:prepare
      had committed and tagged. The script now signs a test message before
      anything else, which also unlocks the key in the agent.
    - The default version was read before switching to wicket-8.x, so after
      a failed run it came from the build branch and suggested the next
      version. The script checks out wicket-8.x first.
    - The generated revert script lost the backslash of "-exec rm {} \;"
      and failed in find; it uses "-exec rm {} +" now.
    
    GitHub issue #1721
    
    Generated-by: Claude Code (Claude Opus 5.5)
---
 build-versions.py | 22 +++++++++++++++++-----
 release.sh        | 17 ++++++++++++-----
 2 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/build-versions.py b/build-versions.py
index d5a5e56df3..39dc91a7f0 100755
--- a/build-versions.py
+++ b/build-versions.py
@@ -9,7 +9,9 @@
 #     build-versions.py <release-version> <dev-version>
 #
 # This will generate a release.properties file that will release the
-# release-version, and will continue development on dev-version.
+# release-version, and will continue development on dev-version. A module
+# with a version of its own, such as the experimental modules, is released
+# at that version without -SNAPSHOT and continues on the next one.
 #
 # Example:
 #
@@ -32,19 +34,29 @@ devVersion = sys.argv[2]
 relVersions = []
 devVersions = []
 
-def addVersions(groupId, artifactId):
-    relVersions.append("project.rel." + groupId + "\\:" + artifactId + "=" + 
relVersion)
-    devVersions.append("project.dev." + groupId + "\\:" + artifactId + "=" + 
devVersion)
+def ownVersions(version):
+    release = version[:-len("-SNAPSHOT")] if version.endswith("-SNAPSHOT") 
else version
+    parts = release.split(".")
+    parts[-1] = str(int(parts[-1]) + 1)
+    return release, ".".join(parts) + "-SNAPSHOT"
+
+def addVersions(groupId, artifactId, version):
+    rel, dev = (relVersion, devVersion) if version == projectVersion else 
ownVersions(version)
+    relVersions.append("project.rel." + groupId + "\\:" + artifactId + "=" + 
rel)
+    devVersions.append("project.dev." + groupId + "\\:" + artifactId + "=" + 
dev)
 
 def addModule(directory):
     pom = ET.parse(os.path.join(directory, "pom.xml")).getroot()
 
     groupId = pom.findtext("pom:groupId", namespaces=NS) or 
pom.findtext("pom:parent/pom:groupId", namespaces=NS)
-    addVersions(groupId, pom.findtext("pom:artifactId", namespaces=NS))
+    version = pom.findtext("pom:version", namespaces=NS) or 
pom.findtext("pom:parent/pom:version", namespaces=NS)
+    addVersions(groupId, pom.findtext("pom:artifactId", namespaces=NS), 
version)
 
     for module in pom.iterfind(".//pom:modules/pom:module", NS):
         addModule(os.path.join(directory, module.text))
 
+projectVersion = ET.parse("pom.xml").getroot().findtext("pom:version", 
namespaces=NS)
+
 addModule(".")
 
 for version in relVersions:
diff --git a/release.sh b/release.sh
index 926bc6053a..3432d7adc0 100755
--- a/release.sh
+++ b/release.sh
@@ -160,7 +160,7 @@ svn rm 
https://dist.apache.org/repos/dist/dev/wicket/$version -m "Release vote h
 mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-drop 
-DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org 
-DserverId=apache.releases.https -Ddescription="Release vote has failed"
 
 # clean up remaining release files
-find . -name "*.releaseBackup" -exec rm {} \\;
+find . -name "*.releaseBackup" -exec rm {} +
 [ -f release.properties ] && rm release.properties
 
 EOF
@@ -374,6 +374,12 @@ Java used to compile (from toolchain) is: 
$(getJdkToolchain)
 
 agentcount=`ps aux|grep gpg-agent|wc -l`
 
+echo "Checking that gpg can sign"
+echo "test" | gpg --clearsign > /dev/null || fail "gpg is unable to sign, 
check gpg-agent and pinentry"
+
+# the version to release comes from $GIT_BRANCH, not from a build branch left 
by a failed run
+git checkout $GIT_BRANCH || fail "Unable to check out $GIT_BRANCH"
+
 current_version=$(getProjectVersionFromPom)
 major_version=$(expr $current_version : '\(.*\)\..*\..*\-.*')
 minor_version=$(expr $current_version : '.*\.\(.*\)\..*\-.*')
@@ -541,19 +547,19 @@ if [ "$(jdk_version)" -gt 10 ] ; then
 fi
 
 echo "Prepare the release"
-mvn --batch-mode release:prepare -X -l $log -DpreparationGoals="clean" 
-Dtag=$tag -Papache-release,release$JDK11_PROFILE
+mvn --batch-mode release:prepare -X -l $log -DpreparationGoals="clean" 
-Dtag=$tag -Daether.connector.basic.parallelPut=false 
-Papache-release,release$JDK11_PROFILE
 if [ $? -ne 0 ] ; then
     fail "ERROR: mvn release:prepare was not successful"
 fi
 
 echo "Performing the release using Maven"
-mvn -Dgpg.passphrase="$passphrase" -ff -l $log release:perform 
-DlocalCheckout=true -Dtag=$tag -Papache-release,release$JDK11_PROFILE
+mvn -Dgpg.passphrase="$passphrase" -ff -l $log release:perform 
-DlocalCheckout=true -Dtag=$tag -Daether.connector.basic.parallelPut=false 
-Papache-release,release$JDK11_PROFILE
 if [ $? -ne 0 ] ; then
     fail "ERROR: mvn release:perform was not successful"
 fi
 
 # Determine the staging repository and close it after deploying the release to 
the staging area
-stagingrepoid=$(mvn 
org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-list 
-DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https | 
grep -v "OPEN" | grep -Eo "(orgapachewicket-\d+)";)
+stagingrepoid=$(mvn 
org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-list 
-DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https | 
grep -v "CLOSED" | grep -Eo "orgapachewicket-[0-9]+")
 
 echo "Closing staging repository with id $stagingrepoid"
 mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-close 
-DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org 
-DserverId=apache.releases.https -Ddescription="Release has been built, 
awaiting vote"
@@ -678,7 +684,8 @@ git commit -m "Added post-release scripts and vote/release 
email templates"
 
 echo "Signing the release tag"
 git checkout $tag
-git tag --sign --force --message \"Signed release tag for Apache Wicket 
$version\" $tag >> $log
+git tag --sign --force --message "Signed release tag for Apache Wicket 
$version" $tag >> $log \
+    || fail "Unable to sign the release tag $tag"
 git checkout $branch
 
 echo "Pushing build artifacts to the staging repository"

Reply via email to