Class ReactorPom
Where PomRewriter owns release-path POM
edits (dependency/parent/plugin/property versions), this class owns
the workspace-reactor concern: the top-level <subprojects>
block and the legacy with-<name> file-activated profiles that
preceded it.
Two membership encodings
- Modern — unconditional top-level
<subprojects><subproject>name</subproject></subprojects>.ike-workspace-extension'sSubprojectPruneTransformer(IKE-Network/ike-issues#460) prunes entries whose directory is absent at model-read time, so the declaration is safe even when a subproject has not been cloned yet. - Legacy — one
<profile>per subproject, idwith-<name>,<file><exists>-activated, declaring the member inside the profile's own<subprojects>. This is whatws:addhistorically generated; this class migrates it away.
All methods are pure: they take POM text and return POM text, leaving the input unchanged when there is nothing to do.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne legacy subproject-membership profile: its<id>and the subproject name(s) declared inside its<subprojects>block. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<ReactorPom.ProfileEntry> listSubprojectProfiles(String pomContent) List the reactor POM's legacy subproject-membership profiles — the<profile>s that declare one or more members inside their own<subprojects>block (thewith-<name>pattern thatws:addgenerated before the #460 migration).listSubprojects(String pomContent) List the reactor POM's top-level<subprojects>entries in declaration order.static StringremoveProfile(String pomContent, String profileId) Remove a single<profile>(matched by<id>) from the reactor POM, and drop the<profiles>block entirely if it becomes empty.static StringsetSubprojects(String pomContent, List<String> names) Set the reactor POM's top-level<subprojects>block to exactlynames, in the given order.
-
Method Details
-
listSubprojects
-
listSubprojectProfiles
List the reactor POM's legacy subproject-membership profiles — the<profile>s that declare one or more members inside their own<subprojects>block (thewith-<name>pattern thatws:addgenerated before the #460 migration).A profile qualifies when it carries a non-empty
<subprojects>; thewith-id and<file><exists>activation are the convention but are not required for the match, so a hand-edited profile is recognized too.- Parameters:
pomContent- the raw POM text- Returns:
- the qualifying profiles in declaration order; empty when none
-
setSubprojects
Set the reactor POM's top-level<subprojects>block to exactlynames, in the given order. Replaces an existing block in place (preserving its surrounding whitespace) or inserts a new one — before<profiles>when present, otherwise at the end of<project>.This single operation covers add (
ws:add), remove (ws:remove), and full reconciliation againstworkspace.yaml: callers compute the target list and let this method materialize it idempotently.- Parameters:
pomContent- the raw POM textnames- the exact subproject membership to declare- Returns:
- updated POM text; unchanged when the block already matches
-
removeProfile
Remove a single<profile>(matched by<id>) from the reactor POM, and drop the<profiles>block entirely if it becomes empty.- Parameters:
pomContent- the raw POM textprofileId- the profile id to remove (e.g.with-komet)- Returns:
- updated POM text; unchanged when no such profile exists
-