org.apache.maven.report.projectinfo.dependencies
Class RepositoryUtils
java.lang.Object
org.apache.maven.report.projectinfo.dependencies.RepositoryUtils
public class RepositoryUtils
- extends Object
Utilities methods to play with repository
- Since:
- 2.1
- Version:
- $Id: RepositoryUtils.java 1335575 2012-05-08 15:15:32Z hboutemy $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RepositoryUtils
public RepositoryUtils(Log log,
WagonManager wagonManager,
Settings settings,
MavenProjectBuilder mavenProjectBuilder,
org.apache.maven.artifact.factory.ArtifactFactory factory,
ArtifactResolver resolver,
List<ArtifactRepository> remoteRepositories,
List<ArtifactRepository> pluginRepositories,
ArtifactRepository localRepository,
RepositoryMetadataManager repositoryMetadataManager)
- Parameters:
log
- wagonManager
- settings
- mavenProjectBuilder
- factory
- resolver
- remoteRepositories
- pluginRepositories
- localRepository
- repositoryMetadataManager
-
getLocalRepository
public ArtifactRepository getLocalRepository()
- Returns:
- localrepo
getRemoteArtifactRepositories
public List<ArtifactRepository> getRemoteArtifactRepositories()
- Returns:
- remote artifact repo
getPluginArtifactRepositories
public List<ArtifactRepository> getPluginArtifactRepositories()
- Returns:
- plugin artifact repo
resolve
public void resolve(Artifact artifact)
throws ArtifactResolutionException,
ArtifactNotFoundException
- Parameters:
artifact
- not null
- Throws:
ArtifactResolutionException
- if any
ArtifactNotFoundException
- if any- See Also:
ArtifactResolver.resolve(Artifact, List, ArtifactRepository)
dependencyExistsInRepo
public boolean dependencyExistsInRepo(ArtifactRepository repo,
Artifact artifact)
- Parameters:
repo
- not nullartifact
- not null
- Returns:
true
if the artifact exists in the given repo, false
otherwise or if
the repo is blacklisted.
getMavenProjectFromRepository
public MavenProject getMavenProjectFromRepository(Artifact artifact)
throws ProjectBuildingException
- Get the
Maven project
from the repository depending the Artifact
given.
- Parameters:
artifact
- an artifact
- Returns:
- the Maven project for the given artifact
- Throws:
ProjectBuildingException
- if any
getDependencyUrlFromRepository
public String getDependencyUrlFromRepository(Artifact artifact,
ArtifactRepository repo)
- Parameters:
artifact
- not nullrepo
- not null
- Returns:
- the artifact url in the given repo for the given artifact. If it is a snapshot artifact, the version
will be the timestamp and the build number from the metadata. Could return null if the repo is blacklisted.
Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.