This is an automated email from the ASF dual-hosted git repository.
robertlazarski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git
The following commit(s) were added to refs/heads/master by this push:
new f30a53da91 Skip the sample-pom sync unless a release version is being
built
f30a53da91 is described below
commit f30a53da91955c2692934967bc0916da2f66983e
Author: Robert Lazarski <[email protected]>
AuthorDate: Mon Sep 7 10:54:12 2026 -1000
Skip the sample-pom sync unless a release version is being built
Dropping completionGoals left the samples pinned to the last released
version
between releases, which made a dry run destructive: it sees the
untransformed
SNAPSHOT, rewrites the samples off that pin and stages them, and nothing
reverts
a dry run. The target now runs only when project.version is not a SNAPSHOT.
Rehearsed all three paths on a throwaway clone: a dry run in the
post-release
state leaves the samples untouched and nothing staged, and a real prepare
still
tags 2.0.2 in all three.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---
pom.xml | 18 +++++++++++++++++-
src/site/markdown/release-process.md | 12 ++++++++----
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index 131539510e..3e845b4653 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1380,7 +1380,22 @@
<goal>run</goal>
</goals>
<configuration>
- <target>
+ <target xmlns:if="ant:if"
xmlns:unless="ant:unless">
+ <!-- Only sync for a real release version.
release:prepare
+ transforms the poms first, so
${project.version} is the
+ release version by the time this runs. A
dry run does
+ not transform them, so this is a SNAPSHOT
and the whole
+ body is skipped: without the guard a dry
run would
+ rewrite the samples off the last released
version and
+ leave them staged, since nothing reverts
a dry run. -->
+ <condition property="axis2.syncing.a.release">
+ <not>
+ <contains string="${project.version}"
substring="-SNAPSHOT"/>
+ </not>
+ </condition>
+ <echo unless:set="axis2.syncing.a.release"
+ message="${project.version} is a
SNAPSHOT - leaving the userguide sample poms alone"/>
+ <sequential if:set="axis2.syncing.a.release">
<echo message="Setting axis2.version to
${project.version} in the userguide Spring Boot samples"/>
<replaceregexp
match="<axis2\.version>[^<]*</axis2\.version>"
@@ -1428,6 +1443,7 @@
</not>
</condition>
</fail>
+ </sequential>
</target>
</configuration>
</execution>
diff --git a/src/site/markdown/release-process.md
b/src/site/markdown/release-process.md
index 859263b880..a361bf22ad 100644
--- a/src/site/markdown/release-process.md
+++ b/src/site/markdown/release-process.md
@@ -152,10 +152,14 @@ You may also execute a dry run of the release process:
mvn release:prepare -Ddry
deliberate: master's samples then point at a real published artifact,
and the
next release rewrites them again.
- A `-DdryRun=true` run does **not** exercise any of this. A dry run never
replaces
- `pom.xml`, so the goal sees the SNAPSHOT version and writes it straight
back, and no
- commit happens at all. Only a real `release:prepare` transforms the poms
first,
- which is why the check above is on the release commit.
+ The whole body is skipped unless `${project.version}` is a non-SNAPSHOT,
which is
+ what makes a `-DdryRun=true` run safe: a dry run never replaces `pom.xml`,
so the
+ goal sees the SNAPSHOT and does nothing. Without that guard a dry run
would rewrite
+ the samples off the last released version *and stage them*, and nothing
reverts a
+ dry run -- the RM would be left with staged changes that any later commit
would
+ sweep up. It also means a dry run cannot verify the sync; only a real
+ `release:prepare` transforms the poms first, which is why the check above
is on the
+ release commit.
The same class of problem bites any sample kept out of the reactor:
`swagger-server` sat at `2.0.1-SNAPSHOT` through the whole 2.0.1 cycle
because