Package org.ops4j.pax.url.mvn.internal
Class AetherBasedResolver
- java.lang.Object
-
- org.ops4j.pax.url.mvn.internal.AetherBasedResolver
-
- All Implemented Interfaces:
Closeable,AutoCloseable,MavenResolver
public class AetherBasedResolver extends Object implements MavenResolver
Aether based, drop in replacement for mvn protocol
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ops4j.pax.url.mvn.MavenResolver
MavenResolver.RetryChance
-
-
Constructor Summary
Constructors Constructor Description AetherBasedResolver(MavenConfiguration configuration)Create a AetherBasedResolverAetherBasedResolver(MavenConfiguration configuration, MirrorInfo mirror)Create a AetherBasedResolver
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected org.eclipse.aether.RepositoryExceptionfindAetherException(Exception e)Find top-most Aether exceptionList<org.eclipse.aether.repository.RemoteRepository>getRepositories()org.eclipse.aether.RepositorySystemgetRepositorySystem()MavenResolver.RetryChanceisRetryableException(Exception exception)Returns a hint about possible retry of operation that ended withexceptionorg.eclipse.aether.RepositorySystemSessionnewSession()Fileresolve(String url)Resolve and download a maven based urlFileresolve(String url, Exception previousException)Resolve and download a maven based url - possibly as another attempt.Fileresolve(String groupId, String artifactId, String classifier, String extension, String version)Resolve maven artifact as file in repository.Fileresolve(String groupId, String artifactId, String classifier, String extension, String version, Exception previousException)Resolve and download an artifact - possibly as another attempt.Fileresolve(String groupId, String artifactId, String classifier, String extension, String version, MavenRepositoryURL repositoryURL, Exception previousException)Resolve maven artifact as file in repository.Fileresolve(org.eclipse.aether.artifact.Artifact artifact)Resolve maven artifact as file in repository.Fileresolve(org.eclipse.aether.artifact.Artifact artifact, MavenRepositoryURL repositoryURL, Exception previousException)Resolve maven artifact as file in repository.FileresolveMetadata(String groupId, String artifactId, String type, String version)Resolve the maven metadata xml for the specified groupId:artifactId:versionFileresolveMetadata(String groupId, String artifactId, String type, String version, Exception previousException)Resolve the maven metadata xml for the specified groupId:artifactId:version - possibly as another attempt.protected ThrowablerootException(Exception ex)Find root exceptionvoidupload(String groupId, String artifactId, String classifier, String extension, String version, File file)Install the specified artifact in the local repositoryvoiduploadMetadata(String groupId, String artifactId, String type, String version, File file)Install the specified artifact metadata in the local repository
-
-
-
Constructor Detail
-
AetherBasedResolver
public AetherBasedResolver(MavenConfiguration configuration)
Create a AetherBasedResolver- Parameters:
configuration- (must be not null)
-
AetherBasedResolver
public AetherBasedResolver(MavenConfiguration configuration, MirrorInfo mirror)
Create a AetherBasedResolver- Parameters:
configuration- (must be not null)
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getRepositorySystem
public org.eclipse.aether.RepositorySystem getRepositorySystem()
-
getRepositories
public List<org.eclipse.aether.repository.RemoteRepository> getRepositories()
-
resolve
public File resolve(String url) throws IOException
Description copied from interface:MavenResolverResolve and download a maven based url- Specified by:
resolvein interfaceMavenResolver- Throws:
IOException
-
resolve
public File resolve(String url, Exception previousException) throws IOException
Description copied from interface:MavenResolverResolve and download a maven based url - possibly as another attempt. SpecifyingpreviousExceptionis a hint to resolver.- Specified by:
resolvein interfaceMavenResolver- Throws:
IOException
-
resolve
public File resolve(String groupId, String artifactId, String classifier, String extension, String version) throws IOException
Resolve maven artifact as file in repository.- Specified by:
resolvein interfaceMavenResolver- Throws:
IOException
-
resolve
public File resolve(String groupId, String artifactId, String classifier, String extension, String version, Exception previousException) throws IOException
Description copied from interface:MavenResolverResolve and download an artifact - possibly as another attempt. SpecifyingpreviousExceptionis a hint to resolver.- Specified by:
resolvein interfaceMavenResolver- Throws:
IOException
-
resolve
public File resolve(String groupId, String artifactId, String classifier, String extension, String version, MavenRepositoryURL repositoryURL, Exception previousException) throws IOException
Resolve maven artifact as file in repository.- Throws:
IOException
-
resolve
public File resolve(org.eclipse.aether.artifact.Artifact artifact) throws IOException
Resolve maven artifact as file in repository.- Throws:
IOException
-
resolve
public File resolve(org.eclipse.aether.artifact.Artifact artifact, MavenRepositoryURL repositoryURL, Exception previousException) throws IOException
Resolve maven artifact as file in repository.- Throws:
IOException
-
resolveMetadata
public File resolveMetadata(String groupId, String artifactId, String type, String version) throws IOException
Description copied from interface:MavenResolverResolve the maven metadata xml for the specified groupId:artifactId:version- Specified by:
resolveMetadatain interfaceMavenResolver- Throws:
IOException
-
resolveMetadata
public File resolveMetadata(String groupId, String artifactId, String type, String version, Exception previousException) throws IOException
Description copied from interface:MavenResolverResolve the maven metadata xml for the specified groupId:artifactId:version - possibly as another attempt. SpecifyingpreviousExceptionis a hint to resolver.- Specified by:
resolveMetadatain interfaceMavenResolver- Throws:
IOException
-
upload
public void upload(String groupId, String artifactId, String classifier, String extension, String version, File file) throws IOException
Description copied from interface:MavenResolverInstall the specified artifact in the local repository- Specified by:
uploadin interfaceMavenResolver- Throws:
IOException
-
uploadMetadata
public void uploadMetadata(String groupId, String artifactId, String type, String version, File file) throws IOException
Description copied from interface:MavenResolverInstall the specified artifact metadata in the local repository- Specified by:
uploadMetadatain interfaceMavenResolver- Throws:
IOException
-
isRetryableException
public MavenResolver.RetryChance isRetryableException(Exception exception)
Description copied from interface:MavenResolverReturns a hint about possible retry of operation that ended withexception- Specified by:
isRetryableExceptionin interfaceMavenResolver- Returns:
-
findAetherException
protected org.eclipse.aether.RepositoryException findAetherException(Exception e)
Find top-most Aether exception- Parameters:
e-- Returns:
-
rootException
protected Throwable rootException(Exception ex)
Find root exception- Parameters:
ex-- Returns:
-
newSession
public org.eclipse.aether.RepositorySystemSession newSession()
-
-