Interface MavenVersionsResolver

  • All Superinterfaces:
    AutoCloseable, Closeable

    public interface MavenVersionsResolver
    extends Closeable
    SPI Interface implemented by tooling doing the Maven request to get all the versions for the given artifact. A client of this library is responsible for implementation MavenVersionsResolver to query Maven for all the versions for a given Artifact.
    • Method Detail

      • getAllVersions

        Set<String> getAllVersions​(String groupId,
                                   String artifactId,
                                   String extension,
                                   String classifier)
        Returns all the versions provided by Maven for the given artifact.
        Parameters:
        groupId - Maven GroupId - required
        artifactId - Maven ArtifactId - required
        extension - Maven extension - can be null
        classifier - Maven classifier - can be null
        Returns:
        the set of versions.
      • resolveArtifact

        File resolveArtifact​(String groupId,
                             String artifactId,
                             String extension,
                             String classifier,
                             String version)
                      throws UnresolvedMavenArtifactException
        Resolve the maven artifact based on the full coordinates.
        Parameters:
        groupId - Maven GroupId - required
        artifactId - Maven ArtifactId - required
        extension - Maven extension - can be null
        classifier - Maven classifier - can be null
        version - Maven version - required
        Returns:
        a File representing the resolved Maven artifact.
        Throws:
        UnresolvedMavenArtifactException - if th artifact can not be resolved.