public class MavenMetadataSource extends org.codehaus.plexus.logging.AbstractLogEnabled implements ArtifactMetadataSource
| Modifier and Type | Class and Description |
|---|---|
private static class |
MavenMetadataSource.ProjectRelocation |
| Modifier and Type | Field and Description |
|---|---|
private ArtifactFactory |
artifactFactory |
private MavenProjectBuilder |
mavenProjectBuilder |
private RepositoryMetadataManager |
repositoryMetadataManager |
static java.lang.String |
ROLE_HINT |
private MavenProject |
superProject |
private java.util.Set |
warnedPoms |
ROLE| Constructor and Description |
|---|
MavenMetadataSource() |
| Modifier and Type | Method and Description |
|---|---|
private java.util.List |
aggregateRepositoryLists(java.util.List remoteRepositories,
java.util.List remoteArtifactRepositories) |
static java.util.Set |
createArtifacts(ArtifactFactory artifactFactory,
java.util.List dependencies,
java.lang.String inheritedScope,
ArtifactFilter dependencyFilter,
MavenProject project) |
private java.lang.String |
getRelocationKey(Artifact artifact) |
ResolutionGroup |
retrieve(Artifact artifact,
ArtifactRepository localRepository,
java.util.List remoteRepositories)
Retrieve the metadata for the project from the repository.
|
java.util.List |
retrieveAvailableVersions(Artifact artifact,
ArtifactRepository localRepository,
java.util.List remoteRepositories)
Get a list of available versions for an artifact in the remote repository
|
Artifact |
retrieveRelocatedArtifact(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.ProjectRelocation |
retrieveRelocatedProject(Artifact artifact,
ArtifactRepository localRepository,
java.util.List remoteRepositories) |
public static final java.lang.String ROLE_HINT
private MavenProjectBuilder mavenProjectBuilder
private ArtifactFactory artifactFactory
private RepositoryMetadataManager repositoryMetadataManager
private MavenProject superProject
private java.util.Set warnedPoms
public Artifact retrieveRelocatedArtifact(Artifact artifact, ArtifactRepository localRepository, java.util.List remoteRepositories) throws ArtifactMetadataRetrievalException
retrieveRelocatedArtifact in interface ArtifactMetadataSourceArtifactMetadataRetrievalExceptionprivate java.lang.String getRelocationKey(Artifact artifact)
private MavenMetadataSource.ProjectRelocation retrieveRelocatedProject(Artifact artifact, ArtifactRepository localRepository, java.util.List remoteRepositories) throws ArtifactMetadataRetrievalException
public ResolutionGroup retrieve(Artifact artifact, ArtifactRepository localRepository, java.util.List remoteRepositories) throws ArtifactMetadataRetrievalException
retrieve in interface ArtifactMetadataSourceArtifactMetadataRetrievalExceptionprivate java.util.List aggregateRepositoryLists(java.util.List remoteRepositories,
java.util.List remoteArtifactRepositories)
throws ArtifactMetadataRetrievalException
public static java.util.Set createArtifacts(ArtifactFactory artifactFactory, java.util.List dependencies, java.lang.String inheritedScope, ArtifactFilter dependencyFilter, MavenProject project) throws InvalidDependencyVersionException
Set < Artifact >InvalidDependencyVersionExceptionpublic java.util.List retrieveAvailableVersions(Artifact artifact, ArtifactRepository localRepository, java.util.List remoteRepositories) throws ArtifactMetadataRetrievalException
ArtifactMetadataSourceretrieveAvailableVersions in interface ArtifactMetadataSourceartifact - 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 repositoryremoteRepositories - remote repositories, List $lt; ArtifactRepository >List $lt; ArtifactVersion >ArtifactMetadataRetrievalException - in case of error while retrieving repository metadata from the repository.