Class MavenMetadataSource
java.lang.Object
org.apache.maven.project.artifact.MavenMetadataSource
- All Implemented Interfaces:
ArtifactMetadataSource
,ArtifactMetadataSource
- Direct Known Subclasses:
DefaultMetadataSource
@Named("maven")
@Singleton
public class MavenMetadataSource
extends Object
implements ArtifactMetadataSource
- Author:
- Jason van Zyl
-
Constructor Summary
ConstructorDescriptionMavenMetadataSource
(RepositoryMetadataManager repositoryMetadataManager, ArtifactFactory artifactFactory, ProjectBuilder projectBuilder, MavenMetadataCache cache, LegacySupport legacySupport, MavenRepositorySystem mavenRepositorySystem) -
Method Summary
Modifier and TypeMethodDescriptioncreateArtifacts
(ArtifactFactory artifactFactory, List<Dependency> dependencies, String inheritedScope, ArtifactFilter dependencyFilter, MavenProject project) Deprecated.retrieve
(Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories) retrieve
(Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories, boolean resolveManagedVersions) retrieve
(MetadataResolutionRequest request) retrieveAvailableVersions
(Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories) Get a list of available versions for an artifact in the remote repositoryretrieveAvailableVersionsFromDeploymentRepository
(Artifact artifact, ArtifactRepository localRepository, ArtifactRepository deploymentRepository) Get a list of available versions for an artifact in the remote deployment repository.
-
Constructor Details
-
MavenMetadataSource
@Inject public MavenMetadataSource(RepositoryMetadataManager repositoryMetadataManager, ArtifactFactory artifactFactory, ProjectBuilder projectBuilder, MavenMetadataCache cache, LegacySupport legacySupport, MavenRepositorySystem mavenRepositorySystem)
-
-
Method Details
-
retrieve
public ResolutionGroup retrieve(Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories) throws ArtifactMetadataRetrievalException - Specified by:
retrieve
in interfaceArtifactMetadataSource
- Specified by:
retrieve
in interfaceArtifactMetadataSource
- Throws:
ArtifactMetadataRetrievalException
-
retrieve
public ResolutionGroup retrieve(Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories, boolean resolveManagedVersions) throws ArtifactMetadataRetrievalException -
retrieve
public ResolutionGroup retrieve(MetadataResolutionRequest request) throws ArtifactMetadataRetrievalException - Specified by:
retrieve
in interfaceArtifactMetadataSource
- Specified by:
retrieve
in interfaceArtifactMetadataSource
- 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 interfaceArtifactMetadataSource
- 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.ArtifactMetadataRetrievalException
-
retrieveAvailableVersions
public List<ArtifactVersion> retrieveAvailableVersions(MetadataResolutionRequest request) throws ArtifactMetadataRetrievalException - Specified by:
retrieveAvailableVersions
in interfaceArtifactMetadataSource
- 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 interfaceArtifactMetadataSource
- Specified by:
retrieveAvailableVersionsFromDeploymentRepository
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 repositorydeploymentRepository
- remote 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.
-