Class PostMutationSync

java.lang.Object
network.ike.plugin.ws.PostMutationSync

public final class PostMutationSync extends Object
Refresh workspace state derived from POMs and on-disk siblings. Called at the end of any goal whose effect can change which siblings are present on disk or what their POMs declare.

Currently one derivation:

  • YamlDepsSync — re-derives each subproject's depends-on edges from POM contents and rewrites workspace.yaml when the graph has drifted.

Earlier revisions also ran IdeProfileSync here to maintain a -P?with-* block in .mvn/maven.config (IKE-Network/ike-issues#276), so IntelliJ would activate the with-* profiles that scoped subprojects into the reactor. That whole mechanism was retired in IKE-Network/ike-issues#460: the ike-workspace-extension prunes non-existent <subprojects> from workspace POMs at model-read time, so IntelliJ sees the right reactor without any profile activation.

The step is idempotent — running this hook back-to-back produces no further changes. Failures are logged at WARN and do not abort the caller.

Self-committing. workspace.yaml is machine-maintained, never hand-authored, so a re-derivation it produces must not be left as an uncommitted working-tree change — that strands the change for the next goal's clean-tree preflight to trip over (the reported failure mode in IKE-Network/ike-issues#774: ws:commit re-derived depends-on edges after its commit loop, and the next ws:push/ws:sync then refused to run). When the re-derivation is the sole pending change to workspace.yaml — i.e. the manifest was committed-clean when the hook ran — it is committed here in isolation. When the manifest already carried a caller's own edit (e.g. ws:add adding a subproject, which deliberately leaves the manifest staged for the user), the combined change is left for that caller's own commit policy and this hook does not commit.

Triggered from: ws:add, ws:remove, ws:sync, ws:pull, ws:commit-publish, ws:scaffold-init, ws:feature-finish-merge-publish, ws:feature-finish-squash-publish, ws:align-publish, ws:scaffold-publish (which subsumes the retired ws:set-parent).

See IKE-Network/ike-issues#279 (origin) and IKE-Network/ike-issues#460 (IdeProfileSync retirement).

  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    refresh(File workspaceRoot, org.apache.maven.api.plugin.Log log)
    Run all post-mutation derivations against the workspace at workspaceRoot, committing a re-derived workspace.yaml in isolation when it is the sole pending change (see the class note on self-committing).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • refresh

      public static boolean refresh(File workspaceRoot, org.apache.maven.api.plugin.Log log)
      Run all post-mutation derivations against the workspace at workspaceRoot, committing a re-derived workspace.yaml in isolation when it is the sole pending change (see the class note on self-committing).
      Parameters:
      workspaceRoot - the workspace root directory
      log - plugin log for status messages
      Returns:
      true if a re-derived workspace.yaml was committed by this call; false if nothing changed or the change was left for the caller to commit