Class PublishedArtifactSet

java.lang.Object
network.ike.workspace.PublishedArtifactSet

public final class PublishedArtifactSet extends Object
Scans a Maven subproject root to determine the complete set of published artifacts (groupId:artifactId pairs).

This is the "published artifact set" from the handoff design: given a subproject root directory, recursively walk the POM hierarchy (root POM plus all subprojects/modules) and collect every groupId:artifactId pair that the subproject publishes.

POM parsing uses simple regex matching (consistent with the ReleaseSupport pattern) rather than a full XML parser. The <parent> block is stripped before extracting the project's own groupId and artifactId; if no groupId is declared outside the parent block, the parent's groupId is inherited.

  • Method Details

    • scan

      public static Set<PublishedArtifactSet.Artifact> scan(Path subprojectRoot) throws IOException
      Scan a subproject root and return the complete set of published artifacts (groupId:artifactId pairs).

      Reads the root pom.xml, extracts its coordinates, then recursively descends into each subproject (or module) directory to collect all published artifacts.

      Parameters:
      subprojectRoot - the root directory of the Maven subproject
      Returns:
      the set of all published artifacts
      Throws:
      IOException - if a POM file cannot be read
    • matches

      public static boolean matches(Set<PublishedArtifactSet.Artifact> artifacts, String groupId, String artifactId)
      Check whether a groupId:artifactId pair is in the published set.
      Parameters:
      artifacts - the set from scan(Path)
      groupId - the groupId to check
      artifactId - the artifactId to check
      Returns:
      true if the pair is in the set