Class SessionCandidateVersionResolver

java.lang.Object
network.ike.plugin.support.version.SessionCandidateVersionResolver
All Implemented Interfaces:
CandidateVersionResolver

public final class SessionCandidateVersionResolver extends Object implements 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 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

      public List<String> resolveCandidates(String groupId, String artifactId, String currentVersion)
      Description copied from interface: CandidateVersionResolver
      Look up all known released versions of groupId:artifactId.

      Implementations may use currentVersion as 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:
      resolveCandidates in interface CandidateVersionResolver
      Parameters:
      groupId - the coordinate's groupId
      artifactId - the coordinate's artifactId
      currentVersion - the currently-declared version, used as a hint for range-based resolvers; may be null
      Returns:
      ascending list of released versions; empty if none