Class FeatureVersionReconciler
- All Implemented Interfaces:
Reconciler
On a feature branch every subproject's version must carry the
branch slug (<base>-<slug>-SNAPSHOT) so feature builds are
isolated from main SNAPSHOTs. ws:feature-start applies this
once, at branch-creation; a subproject added later (via
ws:add) — or otherwise left un-qualified — stays un-isolated
and its feature build collides with its own main SNAPSHOT. This
reconciler self-heals that on scaffold-publish.
Scope is each subproject's own <version> (its POM) plus the
denormalized version field in workspace.yaml.
Propagating the new version into consumers' dependency
references is left to AlignmentReconciler, which runs after
this one in ReconcilerRegistry.
The target branch is read from the manifest (branch: per
subproject), not git, so the reconciler is deterministic and
branch-coherent. It is a no-op for main-tracking subprojects
and for members already qualified —
VersionSupport.branchQualifiedVersion(String, String) strips any existing slug
before re-applying, so repeated runs converge.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(WorkspaceContext ctx) Apply reconciliation.detect(WorkspaceContext ctx) Inspect the workspace and report any drift this reconciler would correct.Human-readable name of the dimension this reconciler owns.The Maven property name (without the-Dprefix) that opts out of this reconciler's apply pass.static voidrewriteOwnVersion(Path pom, String oldVersion, String newVersion) Rewrite a POM's own<version>fromoldVersiontonewVersion.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Reconciler
pinFlag
-
Constructor Details
-
FeatureVersionReconciler
public FeatureVersionReconciler()
-
-
Method Details
-
dimension
Description copied from interface:ReconcilerHuman-readable name of the dimension this reconciler owns. Used as the heading inscaffold-draftoutput.- Specified by:
dimensionin interfaceReconciler- Returns:
- the dimension label, e.g. "Denormalized YAML fields"
-
optOutFlag
Description copied from interface:ReconcilerThe Maven property name (without the-Dprefix) that opts out of this reconciler's apply pass. Setting the property to"false"skips this dimension on a givenscaffold-publishinvocation.- Specified by:
optOutFlagin interfaceReconciler- Returns:
- the opt-out flag name, e.g.
"updateFields"
-
detect
Description copied from interface:ReconcilerInspect the workspace and report any drift this reconciler would correct. Read-only — must not mutate the workspace.- Specified by:
detectin interfaceReconciler- Parameters:
ctx- the workspace context- Returns:
- drift report;
DriftReport.noDrift(String)if nothing to do
-
apply
Description copied from interface:ReconcilerApply reconciliation. Caller is responsible for checkingReconcilerOptions.isOptedOut(String)before invoking; implementations may also re-check defensively.- Specified by:
applyin interfaceReconciler- Parameters:
ctx- the workspace context
-
rewriteOwnVersion
public static void rewriteOwnVersion(Path pom, String oldVersion, String newVersion) throws IOException Rewrite a POM's own<version>fromoldVersiontonewVersion. Searches past the<parent>block first, so a parent whose version coincidentally equalsoldVersionis not mistaken for the project version (the project<version>precedes<dependencies>, so the first match after</parent>is the project's own). Public — also reused byws:add's add-time qualification (#574).- Parameters:
pom- the POM patholdVersion- the current project versionnewVersion- the qualified version- Throws:
IOException- if the POM cannot be read or written
-