Class ExtensionsXmlReconciler

java.lang.Object
network.ike.plugin.ws.reconcile.ExtensionsXmlReconciler
All Implemented Interfaces:
Reconciler

public class ExtensionsXmlReconciler extends Object implements Reconciler
Keeps the managed ike-workspace-extension entry in .mvn/extensions.xml in lockstep with the ike-workspace-extension.version property declared in ike-parent (IKE-Network/ike-issues#460).

Maven 4 does not interpolate POM properties inside .mvn/extensions.xml at extension-load time — the version must be a literal string. So the literal is rewritten in place by this reconciler whenever ws:scaffold-publish runs.

On a workspace that predates the managed-block convention (the file is missing the sentinel markers and the extension entry), the reconciler migrates it: it inserts the managed block before the closing </extensions> tag, preserving any other entries (e.g. wagon-ssh-external).

The extension version is read from ws-plugin.properties (filtered at build time by Maven from the ike-workspace-extension.version property in ike-parent).

  • Constructor Details

    • ExtensionsXmlReconciler

      public ExtensionsXmlReconciler()
  • Method Details

    • dimension

      public String dimension()
      Description copied from interface: Reconciler
      Human-readable name of the dimension this reconciler owns. Used as the heading in scaffold-draft output.
      Specified by:
      dimension in interface Reconciler
      Returns:
      the dimension label, e.g. "Denormalized YAML fields"
    • optOutFlag

      public String optOutFlag()
      Description copied from interface: Reconciler
      The Maven property name (without the -D prefix) that opts out of this reconciler's apply pass. Setting the property to "false" skips this dimension on a given scaffold-publish invocation.
      Specified by:
      optOutFlag in interface Reconciler
      Returns:
      the opt-out flag name, e.g. "updateFields"
    • detect

      public DriftReport detect(WorkspaceContext ctx)
      Description copied from interface: Reconciler
      Inspect the workspace and report any drift this reconciler would correct. Read-only — must not mutate the workspace.
      Specified by:
      detect in interface Reconciler
      Parameters:
      ctx - the workspace context
      Returns:
      drift report; DriftReport.noDrift(String) if nothing to do
    • apply

      public void apply(WorkspaceContext ctx)
      Description copied from interface: Reconciler
      Apply reconciliation. Caller is responsible for checking ReconcilerOptions.isOptedOut(String) before invoking; implementations may also re-check defensively.
      Specified by:
      apply in interface Reconciler
      Parameters:
      ctx - the workspace context