Class SessionCandidateVersionResolver
- All Implemented Interfaces:
CandidateVersionResolver
CandidateVersionResolver backed by the Maven 4
VersionRangeResolver service.
Constructs an open version range "(,)" (every version,
inclusive of the lower bound and unbounded upper) and asks the
resolver to enumerate. Results are filtered to drop SNAPSHOTs, then
returned in ascending order.
Network access happens here. Errors from the resolver are
surfaced via VersionResolverFailureException so callers can
decide whether to abort the plan or carry on with a synthetic
"unable to resolve" entry. We deliberately do not silently return
an empty list — that would mask a misconfigured Nexus and produce a
plan that proposes no upgrades for unrelated reasons.
-
Constructor Summary
ConstructorsConstructorDescriptionSessionCandidateVersionResolver(org.apache.maven.api.Session session) Build a resolver bound to a Maven session. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CandidateVersionResolver
resolveHighestCandidate
-
Constructor Details
-
SessionCandidateVersionResolver
public SessionCandidateVersionResolver(org.apache.maven.api.Session session) Build a resolver bound to a Maven session.- Parameters:
session- the active Maven 4 session; provides the resolver service and the configured remote repositories
-
-
Method Details
-
resolveCandidates
Description copied from interface:CandidateVersionResolverLook 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.- Specified by:
resolveCandidatesin interfaceCandidateVersionResolver- 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
-