Interface CandidateVersionResolver
- All Known Implementing Classes:
SessionCandidateVersionResolver
public interface CandidateVersionResolver
Resolves the available released versions of a Maven coordinate.
Pure interface so FoundationBaker can be unit tested
with a fake (no Maven session, no network). The
SessionCandidateVersionResolver implementation queries the
Maven 4 VersionRangeResolver service against the configured
remote and local repositories.
Implementations MUST:
- Filter out SNAPSHOT versions — foundation resolution only ever proposes released versions.
- Return versions in ascending order, with the highest at the end of the list.
- Return an empty list (not null) when nothing is available or the coordinate cannot be resolved.
-
Method Summary
Modifier and TypeMethodDescriptionresolveCandidates(String groupId, String artifactId, String currentVersion) Look up all known released versions ofgroupId:artifactId.default StringresolveHighestCandidate(String groupId, String artifactId, String currentVersion) Convenience: return the highest released candidate strictly newer thancurrentVersion, or null if there isn't one.
-
Method Details
-
resolveCandidates
Look up all known released versions ofgroupId:artifactId.Implementations may use
currentVersionas a hint — e.g. to construct a Maven version range like"(currentVersion,)"that only returns strictly newer versions. Callers must not depend on that filtering: they should still compare returned versions against the current version themselves.- Parameters:
groupId- the coordinate's groupIdartifactId- the coordinate's artifactIdcurrentVersion- the currently-declared version, used as a hint for range-based resolvers; may be null- Returns:
- ascending list of released versions; empty if none
-
resolveHighestCandidate
Convenience: return the highest released candidate strictly newer thancurrentVersion, or null if there isn't one. Compares versions withMavenVersionComparator.INSTANCE.- Parameters:
groupId- the coordinate's groupIdartifactId- the coordinate's artifactIdcurrentVersion- the currently-declared version- Returns:
- the highest strictly-newer candidate, or null
-