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 Classes Modifier and Type Class Description private static classMavenMetadataSource.ProjectRelocation
-
Field Summary
Fields Modifier and Type Field Description private ArtifactFactoryartifactFactoryprivate MavenProjectBuildermavenProjectBuilderprivate RepositoryMetadataManagerrepositoryMetadataManagerstatic java.lang.StringROLE_HINTprivate MavenProjectsuperProjectprivate java.util.SetwarnedPoms-
Fields inherited from interface org.apache.maven.artifact.metadata.ArtifactMetadataSource
ROLE
-
-
Constructor Summary
Constructors Constructor Description MavenMetadataSource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.ListaggregateRepositoryLists(java.util.List remoteRepositories, java.util.List remoteArtifactRepositories)static java.util.SetcreateArtifacts(ArtifactFactory artifactFactory, java.util.List dependencies, java.lang.String inheritedScope, ArtifactFilter dependencyFilter, MavenProject project)private java.lang.StringgetRelocationKey(Artifact artifact)ResolutionGroupretrieve(Artifact artifact, ArtifactRepository localRepository, java.util.List remoteRepositories)Retrieve the metadata for the project from the repository.java.util.ListretrieveAvailableVersions(Artifact artifact, ArtifactRepository localRepository, java.util.List remoteRepositories)Get a list of available versions for an artifact in the remote repositoryArtifactretrieveRelocatedArtifact(Artifact artifact, ArtifactRepository localRepository, java.util.List remoteRepositories)Resolve all relocations in the POM for this artifact, and return the new artifact coordinate.private MavenMetadataSource.ProjectRelocationretrieveRelocatedProject(Artifact artifact, ArtifactRepository localRepository, java.util.List remoteRepositories)
-
-
-
Field Detail
-
ROLE_HINT
public static final java.lang.String ROLE_HINT
- See Also:
- Constant Field Values
-
mavenProjectBuilder
private MavenProjectBuilder mavenProjectBuilder
-
artifactFactory
private ArtifactFactory artifactFactory
-
repositoryMetadataManager
private RepositoryMetadataManager repositoryMetadataManager
-
superProject
private MavenProject superProject
-
warnedPoms
private java.util.Set warnedPoms
-
-
Method Detail
-
retrieveRelocatedArtifact
public Artifact retrieveRelocatedArtifact(Artifact artifact, ArtifactRepository localRepository, java.util.List remoteRepositories) throws ArtifactMetadataRetrievalException
Resolve all relocations in the POM for this artifact, and return the new artifact coordinate.- Specified by:
retrieveRelocatedArtifactin interfaceArtifactMetadataSource- Throws:
ArtifactMetadataRetrievalException
-
getRelocationKey
private java.lang.String getRelocationKey(Artifact artifact)
-
retrieveRelocatedProject
private MavenMetadataSource.ProjectRelocation retrieveRelocatedProject(Artifact artifact, ArtifactRepository localRepository, java.util.List remoteRepositories) throws ArtifactMetadataRetrievalException
-
retrieve
public ResolutionGroup retrieve(Artifact artifact, ArtifactRepository localRepository, java.util.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:
retrievein interfaceArtifactMetadataSource- Throws:
ArtifactMetadataRetrievalException
-
aggregateRepositoryLists
private java.util.List aggregateRepositoryLists(java.util.List remoteRepositories, java.util.List remoteArtifactRepositories) throws ArtifactMetadataRetrievalException
-
createArtifacts
public static java.util.Set createArtifacts(ArtifactFactory artifactFactory, java.util.List dependencies, java.lang.String inheritedScope, ArtifactFilter dependencyFilter, MavenProject project) throws InvalidDependencyVersionException
- Returns:
Set<Artifact>- Throws:
InvalidDependencyVersionException
-
retrieveAvailableVersions
public java.util.List retrieveAvailableVersions(Artifact artifact, ArtifactRepository localRepository, java.util.List remoteRepositories) throws ArtifactMetadataRetrievalException
Description copied from interface:ArtifactMetadataSourceGet a list of available versions for an artifact in the remote repository- Specified by:
retrieveAvailableVersionsin interfaceArtifactMetadataSource- Parameters:
artifact- artifact we are interested in. OnlygroupidandartifactIdare 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.
-
-