Class AlignmentReconciler
java.lang.Object
network.ike.plugin.ws.reconcile.AlignmentReconciler
- All Implemented Interfaces:
Reconciler
Reconciler that aligns inter-subproject dependency, plugin, and
parent versions across every cloned subproject's POMs to the
authoritative versions declared by the workspace.
Subsumes the ws:align-{draft,publish} business logic
(IKE-Network/ike-issues#393). Unlike most other reconciler
migrations, the standalone ws:align-draft and
ws:align-publish Maven goals are retained as thin
wrappers over this reconciler: alignment drift arises from many
distinct moments (post-release cascade, manual POM edits, feature
work, scaffold drift), so the reconciler is also invoked from
ws:scaffold-publish as part of the convergence pass. The
standalone goals remain as the explicit "I detected misalignment,
run only that" entry point.
What this reconciler aligns
- Dependency versions — for each POM, when a
<dependency>references another workspace subproject's artifact (groupId:artifactIdmatches the artifact set published by that subproject), the declared version is updated to match the subproject's current POM version. Property-based versions (${ike-bom.version}) update the property; direct<version>tags rewrite in place. - Plugin versions — same matching for
<plugin>declarations. Property-based plugin versions are deferred to the dependency/property alignment pass above. - Parent versions — when a subproject declares another
subproject as its parent (via the manifest
parent:field), and the parent subproject's version differs from the child's<parent><version>, the child POM (and any submodule POMs referencing the same parent GAV) is updated. This is distinct fromParentVersionReconciler, which cascades the workspace root POM's parent across subprojects.
Reads use Maven 4's PomModel (Model API, no regex).
Writes go through PomModel's OpenRewrite-LST-backed
updaters — see feedback_no_sed_on_poms.
Opt out with -DupdateAlignment=false.
-
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.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Reconciler
pinFlag
-
Constructor Details
-
AlignmentReconciler
public AlignmentReconciler()
-
-
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
-