Class CoherenceVerifier
ResolutionScope, and its own upstream
pins are confirmed current against fresh metadata.
Both checks assert only about this module — never about its upstreams or which siblings are mid-cascade. Coherence emerges because the TeamCity finish-trigger fires the downstream only on the upstream's success, and "success" now includes these checks. An un-resolvable artifact (or a pin that silently failed to catch up) fails this build, the finish-trigger does not fire, and the cascade stops — incoherence is a red build on the responsible module, never a silently-wrong downstream.
Cold resolution. Both checks run against a session
whose local repository is a fresh, empty temp directory. This is
essential: the module's own .m2 trivially holds the artifact
it just installed, and caches upstream metadata under a daily
update policy — so resolving against the normal local repo would
confirm nothing and could read stale metadata (the exact failure that
shipped the incoherent ike-platform v110 on 2026-06-18). An empty
local repo forces a real fetch from the demanded remote, with the
session's configured credentials preserved.
-
Constructor Summary
ConstructorsConstructorDescriptionCoherenceVerifier(org.apache.maven.api.Session session, org.apache.maven.api.plugin.Log log) Creates a verifier bound to the active session and logger. -
Method Summary
Modifier and TypeMethodDescriptionvoidassertUpstreamPinsCurrent(File gitRoot, ResolutionScope scope) The post-release coherence assert: fail loudly if any of this module's auto-aligned upstream pins did not catch up to the latest released upstream, judged against fresh metadata.voidverifySelfResolves(String groupId, String artifactId, String version, ResolutionScope scope) The headline gate: confirm the just-released artifact resolves cold at the demanded scope, throwing if it does not.
-
Constructor Details
-
CoherenceVerifier
public CoherenceVerifier(org.apache.maven.api.Session session, org.apache.maven.api.plugin.Log log) Creates a verifier bound to the active session and logger.- Parameters:
session- the active Maven session (provides the resolver services, configured remotes, and credentials)log- the release logger
-
-
Method Details
-
verifySelfResolves
public void verifySelfResolves(String groupId, String artifactId, String version, ResolutionScope scope) throws org.apache.maven.api.plugin.MojoException The headline gate: confirm the just-released artifact resolves cold at the demanded scope, throwing if it does not.Resolves the artifact's POM (every released artifact has one, regardless of packaging) against a fresh, empty local repository, so success means a cache-less consumer could genuinely fetch what this build published.
- Parameters:
groupId- the released artifact's groupIdartifactId- the released artifact's artifactIdversion- the released version (no-SNAPSHOT)scope- the demanded resolution scope (must be≥ NEXUSfor publish)- Throws:
org.apache.maven.api.plugin.MojoException- if the artifact does not resolve at the demanded scope
-
assertUpstreamPinsCurrent
public void assertUpstreamPinsCurrent(File gitRoot, ResolutionScope scope) throws org.apache.maven.api.plugin.MojoException The post-release coherence assert: fail loudly if any of this module's auto-aligned upstream pins did not catch up to the latest released upstream, judged against fresh metadata.This is the safety net for the stale-metadata failure mode: the B8 alignment step already raises these pins, but if it read a stale metadata cache it could silently leave a pin behind (shipping an incoherent build). Re-resolving cold here catches that.
Only edges this module would auto-align are asserted —
ReleasePolicy.INTEGRATEandReleasePolicy.RELEASE. Anotify/verify/proposeedge is intentionally hand-gated and legitimately sits behind latest, so asserting it would false-fail. The policy-read mirrorsReleasePrep.alignUpstreamProperties(B8); keep the two in sync.A no-op for a non-cascade member, the cascade head, or a module whose pins are all current.
- Parameters:
gitRoot- the release working tree (its committedpom.xmlis read)scope- the demanded scope whose repo supplies the fresh "latest released"- Throws:
org.apache.maven.api.plugin.MojoException- if an auto-aligned pin is behind the latest released upstream
-