Class MavenMetadataSource
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.apache.maven.project.artifact.MavenMetadataSource
- All Implemented Interfaces:
ArtifactMetadataSource
,org.codehaus.plexus.logging.LogEnabled
public class MavenMetadataSource
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements ArtifactMetadataSource
- Version:
- $Id: MavenMetadataSource.java 736547 2009-01-22 03:57:09Z jdcasey $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ArtifactFactory
private MavenProjectBuilder
private RepositoryMetadataManager
static final String
private MavenProject
private Set
Fields inherited from interface org.apache.maven.artifact.metadata.ArtifactMetadataSource
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate List
aggregateRepositoryLists
(List remoteRepositories, List remoteArtifactRepositories) static Set
createArtifacts
(ArtifactFactory artifactFactory, List dependencies, String inheritedScope, ArtifactFilter dependencyFilter, MavenProject project) private String
getRelocationKey
(Artifact artifact) retrieve
(Artifact artifact, ArtifactRepository localRepository, List remoteRepositories) Retrieve the metadata for the project from the repository.retrieveAvailableVersions
(Artifact artifact, ArtifactRepository localRepository, List remoteRepositories) Get a list of available versions for an artifact in the remote repositoryretrieveRelocatedArtifact
(Artifact artifact, ArtifactRepository localRepository, List remoteRepositories) Resolve all relocations in the POM for this artifact, and return the new artifact coordinate.retrieveRelocatedProject
(Artifact artifact, ArtifactRepository localRepository, List remoteRepositories) Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE_HINT
- See Also:
-
mavenProjectBuilder
-
artifactFactory
-
repositoryMetadataManager
-
superProject
-
warnedPoms
-
-
Constructor Details
-
MavenMetadataSource
public MavenMetadataSource()
-
-
Method Details
-
retrieveRelocatedArtifact
public Artifact retrieveRelocatedArtifact(Artifact artifact, ArtifactRepository localRepository, List remoteRepositories) throws ArtifactMetadataRetrievalException Resolve all relocations in the POM for this artifact, and return the new artifact coordinate.- Specified by:
retrieveRelocatedArtifact
in interfaceArtifactMetadataSource
- Throws:
ArtifactMetadataRetrievalException
-
getRelocationKey
-
retrieveRelocatedProject
private MavenMetadataSource.ProjectRelocation retrieveRelocatedProject(Artifact artifact, ArtifactRepository localRepository, List remoteRepositories) throws ArtifactMetadataRetrievalException -
retrieve
public ResolutionGroup retrieve(Artifact artifact, ArtifactRepository localRepository, List remoteRepositories) throws ArtifactMetadataRetrievalException Retrieve the metadata for the project from the repository. Uses the ProjectBuilder, to enable post-processing and inheritance calculation before retrieving the associated artifacts.- Specified by:
retrieve
in interfaceArtifactMetadataSource
- Throws:
ArtifactMetadataRetrievalException
-
aggregateRepositoryLists
private List aggregateRepositoryLists(List remoteRepositories, List remoteArtifactRepositories) throws ArtifactMetadataRetrievalException -
createArtifacts
public static Set createArtifacts(ArtifactFactory artifactFactory, List dependencies, String inheritedScope, ArtifactFilter dependencyFilter, MavenProject project) throws InvalidDependencyVersionException - Returns:
Set
<Artifact
>- Throws:
InvalidDependencyVersionException
-
retrieveAvailableVersions
public List retrieveAvailableVersions(Artifact artifact, ArtifactRepository localRepository, List 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 interfaceArtifactMetadataSource
- Parameters:
artifact
- artifact we are interested in. Onlygroupid
andartifactId
are needed, for instance the following code will workartifactFactory.createProjectArtifact( "org.apache.maven", "maven", "" )
localRepository
- local repositoryremoteRepositories
- remote repositories,List
$lt;ArtifactRepository
>- Returns:
List
$lt;ArtifactVersion
>- Throws:
ArtifactMetadataRetrievalException
- in case of error while retrieving repository metadata from the repository.
-