org.apache.maven.project.artifact
Class MavenMetadataSource

java.lang.Object
  extended by org.apache.maven.project.artifact.MavenMetadataSource
All Implemented Interfaces:
ArtifactMetadataSource
Direct Known Subclasses:
DefaultMetadataSource

@Component(role=ArtifactMetadataSource.class,
           hint="maven")
public class MavenMetadataSource
extends Object
implements ArtifactMetadataSource

Author:
Jason van Zyl

Constructor Summary
MavenMetadataSource()
           
 
Method Summary
static Set<Artifact> createArtifacts(ArtifactFactory artifactFactory, List<Dependency> dependencies, String inheritedScope, ArtifactFilter dependencyFilter, MavenProject project)
          Deprecated. 
 ResolutionGroup retrieve(Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories)
           
 ResolutionGroup retrieve(Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories, boolean resolveManagedVersions)
           
 ResolutionGroup retrieve(MetadataResolutionRequest request)
           
 List<ArtifactVersion> retrieveAvailableVersions(Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories)
          Get a list of available versions for an artifact in the remote repository
 List<ArtifactVersion> retrieveAvailableVersions(MetadataResolutionRequest request)
           
 List<ArtifactVersion> retrieveAvailableVersionsFromDeploymentRepository(Artifact artifact, ArtifactRepository localRepository, ArtifactRepository deploymentRepository)
          Get a list of available versions for an artifact in the remote deployment repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MavenMetadataSource

public MavenMetadataSource()
Method Detail

retrieve

public ResolutionGroup retrieve(Artifact artifact,
                                ArtifactRepository localRepository,
                                List<ArtifactRepository> remoteRepositories)
                         throws ArtifactMetadataRetrievalException
Specified by:
retrieve in interface ArtifactMetadataSource
Throws:
ArtifactMetadataRetrievalException

retrieve

public ResolutionGroup retrieve(Artifact artifact,
                                ArtifactRepository localRepository,
                                List<ArtifactRepository> remoteRepositories,
                                boolean resolveManagedVersions)
                         throws ArtifactMetadataRetrievalException
Throws:
ArtifactMetadataRetrievalException

retrieve

public ResolutionGroup retrieve(MetadataResolutionRequest request)
                         throws ArtifactMetadataRetrievalException
Specified by:
retrieve in interface ArtifactMetadataSource
Throws:
ArtifactMetadataRetrievalException

retrieveAvailableVersions

public List<ArtifactVersion> retrieveAvailableVersions(Artifact artifact,
                                                       ArtifactRepository localRepository,
                                                       List<ArtifactRepository> remoteRepositories)
                                                throws ArtifactMetadataRetrievalException
Description copied from interface: ArtifactMetadataSource
Get a list of available versions for an artifact in the remote repository

Specified by:
retrieveAvailableVersions in interface ArtifactMetadataSource
Parameters:
artifact - artifact we are interested in. Only groupid and artifactId are needed, for instance the following code will work artifactFactory.createProjectArtifact( "org.apache.maven", "maven", "" )
localRepository - local repository
remoteRepositories - remote repositories, List $lt; ArtifactRepository >
Returns:
List $lt; ArtifactVersion >
Throws:
ArtifactMetadataRetrievalException - in case of error while retrieving repository metadata from the repository.
ArtifactMetadataRetrievalException

retrieveAvailableVersions

public List<ArtifactVersion> retrieveAvailableVersions(MetadataResolutionRequest request)
                                                throws ArtifactMetadataRetrievalException
Throws:
ArtifactMetadataRetrievalException

retrieveAvailableVersionsFromDeploymentRepository

public List<ArtifactVersion> retrieveAvailableVersionsFromDeploymentRepository(Artifact artifact,
                                                                               ArtifactRepository localRepository,
                                                                               ArtifactRepository deploymentRepository)
                                                                        throws ArtifactMetadataRetrievalException
Description copied from interface: ArtifactMetadataSource
Get a list of available versions for an artifact in the remote deployment repository. This ignores any update policy checks and mirrors and always retrieves the latest information from the given repository.

Specified by:
retrieveAvailableVersionsFromDeploymentRepository in interface ArtifactMetadataSource
Parameters:
artifact - artifact we are interested in. Only groupid and artifactId are needed, for instance the following code will work artifactFactory.createProjectArtifact( "org.apache.maven", "maven", "" )
localRepository - local repository
Returns:
List $lt; ArtifactVersion >
Throws:
ArtifactMetadataRetrievalException - in case of error while retrieving repository metadata from the repository.
ArtifactMetadataRetrievalException

createArtifacts

@Deprecated
public static Set<Artifact> createArtifacts(ArtifactFactory artifactFactory,
                                                       List<Dependency> dependencies,
                                                       String inheritedScope,
                                                       ArtifactFilter dependencyFilter,
                                                       MavenProject project)
                                     throws InvalidDependencyVersionException
Deprecated. 

Throws:
InvalidDependencyVersionException


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.