Package org.wildfly.channel.spi
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 implementationMavenVersionsResolverto query Maven for all the versions for a given Artifact.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMavenVersionsResolver.FactoryFactory API to build MavenVersionResolver.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()Set<String>getAllVersions(String groupId, String artifactId, String extension, String classifier)Returns all the versions provided by Maven for the given artifact.FileresolveArtifact(String groupId, String artifactId, String extension, String classifier, String version)Resolve the maven artifact based on the full coordinates.List<File>resolveArtifacts(List<ArtifactCoordinate> coordinates)Resolve a list of maven artifacts based on the full coordinates.
-
-
-
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 - requiredartifactId- Maven ArtifactId - requiredextension- Maven extension - can benullclassifier- Maven classifier - can benull- 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 - requiredartifactId- Maven ArtifactId - requiredextension- Maven extension - can benullclassifier- Maven classifier - can benullversion- Maven version - required- Returns:
- a File representing the resolved Maven artifact.
- Throws:
UnresolvedMavenArtifactException- if the artifact can not be resolved.
-
resolveArtifacts
List<File> resolveArtifacts(List<ArtifactCoordinate> coordinates) throws UnresolvedMavenArtifactException
Resolve a list of maven artifacts based on the full coordinates. The order of returned Files is the same as order of coordinates.- Parameters:
coordinates- - list of ArtifactCoordinates. They need contain at least groupId, artifactId and version.- Returns:
- a list of File representing the resolved Maven artifact.
- Throws:
UnresolvedMavenArtifactException- if any artifacts can not be resolved.
-
close
default void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-