Package org.wildfly.channel.maven
Class VersionResolverFactory
- java.lang.Object
-
- org.wildfly.channel.maven.VersionResolverFactory
-
- All Implemented Interfaces:
Closeable,AutoCloseable,MavenVersionsResolver.Factory
public class VersionResolverFactory extends Object implements MavenVersionsResolver.Factory
-
-
Field Summary
Fields Modifier and Type Field Description static Function<Repository,org.eclipse.aether.repository.RemoteRepository>DEFAULT_REPOSITORY_MAPPERstatic org.eclipse.aether.repository.RepositoryPolicyDEFAULT_REPOSITORY_POLICY
-
Constructor Summary
Constructors Constructor Description VersionResolverFactory(org.eclipse.aether.RepositorySystem system, org.eclipse.aether.RepositorySystemSession session)VersionResolverFactory(org.eclipse.aether.RepositorySystem system, org.eclipse.aether.RepositorySystemSession session, Function<Repository,org.eclipse.aether.repository.RemoteRepository> repositoryFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MavenVersionsResolvercreate(Collection<Repository> repositories)List<Channel>resolveChannels(List<ChannelCoordinate> channelCoords, List<org.eclipse.aether.repository.RemoteRepository> repositories)Resolve and read the channels at the specified coordinates.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.channel.spi.MavenVersionsResolver.Factory
close
-
-
-
-
Field Detail
-
DEFAULT_REPOSITORY_POLICY
public static final org.eclipse.aether.repository.RepositoryPolicy DEFAULT_REPOSITORY_POLICY
-
DEFAULT_REPOSITORY_MAPPER
public static final Function<Repository,org.eclipse.aether.repository.RemoteRepository> DEFAULT_REPOSITORY_MAPPER
-
-
Constructor Detail
-
VersionResolverFactory
public VersionResolverFactory(org.eclipse.aether.RepositorySystem system, org.eclipse.aether.RepositorySystemSession session)
-
VersionResolverFactory
public VersionResolverFactory(org.eclipse.aether.RepositorySystem system, org.eclipse.aether.RepositorySystemSession session, Function<Repository,org.eclipse.aether.repository.RemoteRepository> repositoryFactory)
-
-
Method Detail
-
create
public MavenVersionsResolver create(Collection<Repository> repositories)
- Specified by:
createin interfaceMavenVersionsResolver.Factory
-
resolveChannels
public List<Channel> resolveChannels(List<ChannelCoordinate> channelCoords, List<org.eclipse.aether.repository.RemoteRepository> repositories) throws UnresolvedMavenArtifactException, MalformedURLException
Resolve and read the channels at the specified coordinates. If theChannelCoordinatespecifies a URL, the channel will be fetched from this URL (without reading the Maven coordinates). If theurlisnull, the channel will be resolved as a Maven coordinate. If theversionis null, the channel artifact will be resolved as the latest version according to the Maven repositories metadata, otherwise the exact artifact for the specifiedversionwill be resolved.- Parameters:
channelCoords- A list of Channel coordinates- Returns:
- a List of resolved channels
- Throws:
UnresolvedMavenArtifactException- if the channels can not be resolvedMalformedURLException- if the channel's rul is not properly formed
-
-