Class PomEdgeDeriver

java.lang.Object
network.ike.workspace.cascade.PomEdgeDeriver

public final class PomEdgeDeriver extends Object
Derives the CascadeEdges a project radiates upstream from its Maven model and on-disk layout (IKE-Network/ike-issues#496 part B).

Replaces the hand-authored release-cascade.yaml as the source of an IKE project's upstream edges. The cascade specifies every version-bearing site in an IKE POM as a potential edge, not just <dependencies>: parent inheritance, plain dependencies, dependency-management entries (including imported BOMs), plugins, plugin management, and .mvn/extensions.xml. Under the ${G·A} property convention the property name an alignment step rewrites is mechanical (CascadeEdge.versionProperty()), so no manifest field declares it — the coordinate is enough.

The deriver emits an edge only for coordinates a PomEdgeDeriver.CoordinateFilter accepts; the default filter (PomEdgeDeriver.CoordinateFilter.IKE_GROUP) keeps edges whose groupId starts with network.ike. Third-party dependencies stay out of the graph: IKE does not release them, so they have no place in a release ordering.

A coordinate must bear a <version> at its site to count. A <dependency> that inherits its version from <dependencyManagement> contributes no edge from the dependency site itself; the contributing edge sits at the <dependencyManagement> entry instead.

Self-edges — where a coordinate's reactor-root repository is the same repository as the POM the deriver is scanning — are not filtered here. The deriver knows the POM's coordinates but not its <scm>, and the same repository can publish many coordinates. Self-edge filtering happens after the <scm>-keyed node resolution in IKE-Network/ike-issues#496 part D.

  • Field Details

    • EXTENSIONS_RELATIVE_PATH

      public static final String EXTENSIONS_RELATIVE_PATH
      Conventional path of a Maven 4 build-extensions descriptor.
      See Also:
  • Method Details

    • deriveEdges

      public static List<CascadeEdge> deriveEdges(org.apache.maven.api.model.Model model, Path projectDir)
      Derives the upstream edges of a project from its model and project directory.
      Parameters:
      model - the project's Maven model (typically the file model, but any stage works — the deriver only reads structural fields)
      projectDir - the project's on-disk root directory, used to locate .mvn/extensions.xml; may be null if the caller knows the project has no extensions descriptor
      Returns:
      the derived upstream edges, in the order the sites appear in the POM (parent, dependencies, depMgmt, plugins, pluginMgmt, extensions); never null
    • deriveEdges

      public static List<CascadeEdge> deriveEdges(org.apache.maven.api.model.Model model, Path projectDir, PomEdgeDeriver.CoordinateFilter filter)
      Derives upstream edges with a caller-supplied coordinate filter.
      Parameters:
      model - the project's Maven model
      projectDir - the project's on-disk root directory; may be null
      filter - selects which coordinates produce edges; must not be null
      Returns:
      the derived upstream edges, in source-order; never null
    • deriveEdges

      public static List<CascadeEdge> deriveEdges(org.apache.maven.api.model.Model model, Path projectDir, PomEdgeDeriver.CoordinateFilter filter, RepositoryKey sourceRepo, RepositoryKeyResolver repositoryResolver)
      Derives upstream edges and drops self-edges — edges whose target repository, as resolved by repositoryResolver, equals sourceRepo (IKE-Network/ike-issues#496 part D).

      Self-edges are reactor-internal: a project using its own sibling artifact (ike-tooling consuming ike-maven-plugin, ike-platform consuming ike-workspace-maven-plugin) is a relationship Maven resolves inside the one reactor build, not a cascade edge. Dropping them keeps the topological sort a DAG.

      An edge whose target the resolver cannot locate is kept conservatively — without information, the deriver does not silently filter it out. Callers can chase the unresolved coordinate themselves.

      Parameters:
      model - the project's Maven model
      projectDir - the project's on-disk root directory; may be null
      filter - coordinate filter; required
      sourceRepo - the source POM's RepositoryKey; when null, no self-edge filtering is performed
      repositoryResolver - maps an edge's target coordinate to its RepositoryKey; when null, no self-edge filtering is performed
      Returns:
      external upstream edges in source-order; never null