TrueUpdate Artifact Implementation Maven 0.1.7

net.java.trueupdate.artifact.impl.maven
Class MavenArtifactResolver

java.lang.Object
  extended by net.java.trueupdate.artifact.impl.maven.MavenArtifactResolver
All Implemented Interfaces:
ArtifactResolver

@Immutable
public final class MavenArtifactResolver
extends Object
implements ArtifactResolver

Resolves paths to described artifacts and their latest update by looking them up in a local repository and some optional remote repositories.

Author:
Christian Schlichtherle

Constructor Summary
MavenArtifactResolver(org.eclipse.aether.repository.LocalRepository local, List<org.eclipse.aether.repository.RemoteRepository> remotes)
          Constructs a Maven artifact resolver which uses the given local and remote repositories.
MavenArtifactResolver(org.eclipse.aether.repository.LocalRepository local, org.eclipse.aether.repository.RemoteRepository... remotes)
          Constructs a Maven artifact resolver which uses the given local and remote repositories.
 
Method Summary
static MavenArtifactResolver decodeFromXml(Source source)
          Decodes a maven artifact resolver from XML.
 boolean equals(Object obj)
           
 int hashCode()
           
static JAXBContext jaxbContext()
          Returns a JAXB context which binds only this class.
 org.eclipse.aether.repository.LocalRepository localRepository()
          Returns the local repository.
static URL mainRepositoriesResource()
          Returns the URL of the "main-repositories.xml" resource.
 List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories()
          Returns a list of remote repositories.
 File resolveArtifactFile(ArtifactDescriptor descriptor)
           
 String resolveUpdateVersion(ArtifactDescriptor descriptor)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MavenArtifactResolver

public MavenArtifactResolver(org.eclipse.aether.repository.LocalRepository local,
                             List<org.eclipse.aether.repository.RemoteRepository> remotes)
Constructs a Maven artifact resolver which uses the given local and remote repositories.

Parameters:
local - the local repository.
remotes - the list of remote repositories.

MavenArtifactResolver

public MavenArtifactResolver(org.eclipse.aether.repository.LocalRepository local,
                             org.eclipse.aether.repository.RemoteRepository... remotes)
Constructs a Maven artifact resolver which uses the given local and remote repositories.

Parameters:
local - the local repository.
remotes - the array of remote repositories.
Method Detail

decodeFromXml

public static MavenArtifactResolver decodeFromXml(Source source)
                                           throws Exception
Decodes a maven artifact resolver from XML.

Parameters:
source - the source for reading the XML.
Returns:
the decoded repositories.
Throws:
Exception - at the discretion of the JAXB codec, e.g. if the source isn't readable.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

jaxbContext

public static JAXBContext jaxbContext()
Returns a JAXB context which binds only this class.


localRepository

public org.eclipse.aether.repository.LocalRepository localRepository()
Returns the local repository.


mainRepositoriesResource

public static URL mainRepositoriesResource()
Returns the URL of the "main-repositories.xml" resource.


remoteRepositories

public List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories()
Returns a list of remote repositories. The returned list may be unmodifiable. If it is modifiable, then changing it has no effect on this class.


resolveArtifactFile

public File resolveArtifactFile(ArtifactDescriptor descriptor)
                         throws Exception
Specified by:
resolveArtifactFile in interface ArtifactResolver
Throws:
Exception

resolveUpdateVersion

public String resolveUpdateVersion(ArtifactDescriptor descriptor)
                            throws Exception
Specified by:
resolveUpdateVersion in interface ArtifactResolver
Throws:
Exception

TrueUpdate Artifact Implementation Maven 0.1.7

Copyright © 2013 Stimulus Software. All rights reserved.