Class SiblingRepositoryKeyResolver

java.lang.Object
network.ike.workspace.cascade.SiblingRepositoryKeyResolver
All Implemented Interfaces:
RepositoryKeyResolver

public final class SiblingRepositoryKeyResolver extends Object implements RepositoryKeyResolver
A RepositoryKeyResolver backed by sibling checkouts on the local filesystem (IKE-Network/ike-issues#496 part C).

Scans a base directory of sibling repository checkouts, walks every pom.xml it finds, and indexes the coordinate the POM declares against the RepositoryKey of the repository containing it. Subsequent resolve calls are constant-time map lookups against the index.

How the repository identity is determined

The repository identity is taken from the root POM of the containing git repository, not from Maven inheritance. For each pom.xml found:

  1. Walk upward to the nearest ancestor directory containing a .git entry — the git repo root.
  2. Read that root's pom.xml for its local <scm> block.
  3. Convert the <scm> URL or connection to a RepositoryKey via RepositoryKey.of(String).
  4. Index every coordinate produced under that git repo against this same key.

This bypasses Maven's default <scm> inheritance, which appends each subproject's <artifactId> to the parent's URL (producing paths like .../ike-tooling/ike-build-standards for what is in fact still the ike-tooling repository). The git-boundary read gives every coordinate in a reactor the same key — the goal of the cascade's repository-keyed node model.

Scoping

The scan is bounded: it descends from the supplied base directory but skips target/, .git/, .idea/, node_modules/, and similar build/IDE caches.

  • Constructor Details

    • SiblingRepositoryKeyResolver

      public SiblingRepositoryKeyResolver(Path baseDir)
      Creates a resolver that lazily indexes the POMs under baseDir on the first resolve(MavenCoordinate) call.
      Parameters:
      baseDir - the directory of sibling checkouts; required
  • Method Details