org.apache.maven.artifact.resolver
Class ArtifactResolutionRequest

java.lang.Object
  extended by org.apache.maven.artifact.resolver.ArtifactResolutionRequest
All Implemented Interfaces:
RepositoryRequest

public class ArtifactResolutionRequest
extends Object
implements RepositoryRequest

A resolution request allows you to either use an existing MavenProject, or a coordinate (gid:aid:version) to process a POMs dependencies.

Author:
Jason van Zyl

Constructor Summary
ArtifactResolutionRequest()
           
ArtifactResolutionRequest(RepositoryRequest request)
           
 
Method Summary
 ArtifactResolutionRequest addListener(ResolutionListener listener)
           
 Artifact getArtifact()
           
 Set<Artifact> getArtifactDependencies()
           
 ArtifactFilter getCollectionFilter()
          Gets the artifact filter that controls traversal of the dependency graph.
 List<ResolutionListener> getListeners()
           
 ArtifactRepository getLocalRepository()
          Gets the local repository to use.
 Map<String,Artifact> getManagedVersionMap()
           
 List<Mirror> getMirrors()
           
 List<Proxy> getProxies()
           
 List<ArtifactRepository> getRemoteRepositories()
          Gets the remote repositories to use.
 ArtifactFilter getResolutionFilter()
          Gets the artifact filter that controls downloading of artifact files.
 List<Server> getServers()
           
 boolean isForceUpdate()
          Indicates whether remote repositories should be re-checked for updated artifacts/metadata regardless of their configured update policy.
 boolean isOffline()
          Indicates whether network access to remote repositories has been disabled.
 boolean isResolveRoot()
           
 boolean isResolveTransitively()
           
 ArtifactResolutionRequest setArtifact(Artifact artifact)
           
 ArtifactResolutionRequest setArtifactDependencies(Set<Artifact> artifactDependencies)
           
 ArtifactResolutionRequest setCache(RepositoryCache cache)
           
 ArtifactResolutionRequest setCollectionFilter(ArtifactFilter filter)
           
 ArtifactResolutionRequest setForceUpdate(boolean forceUpdate)
          Enables/disabled forced checks for updated artifacts/metadata on remote repositories.
 ArtifactResolutionRequest setListeners(List<ResolutionListener> listeners)
           
 ArtifactResolutionRequest setLocalRepository(ArtifactRepository localRepository)
          Sets the local repository to use.
 ArtifactResolutionRequest setManagedVersionMap(Map<String,Artifact> managedVersionMap)
           
 ArtifactResolutionRequest setMirrors(List<Mirror> mirrors)
           
 ArtifactResolutionRequest setOffline(boolean offline)
          Enables/disables network access to remote repositories.
 ArtifactResolutionRequest setProxies(List<Proxy> proxies)
           
 ArtifactResolutionRequest setRemoteRepositories(List<ArtifactRepository> remoteRepositories)
          Sets the remote repositories to use.
 ArtifactResolutionRequest setResolutionFilter(ArtifactFilter filter)
           
 ArtifactResolutionRequest setResolveRoot(boolean resolveRoot)
           
 ArtifactResolutionRequest setResolveTransitively(boolean resolveDependencies)
           
 ArtifactResolutionRequest setServers(List<Server> servers)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArtifactResolutionRequest

public ArtifactResolutionRequest()

ArtifactResolutionRequest

public ArtifactResolutionRequest(RepositoryRequest request)
Method Detail

getArtifact

public Artifact getArtifact()

setArtifact

public ArtifactResolutionRequest setArtifact(Artifact artifact)

setArtifactDependencies

public ArtifactResolutionRequest setArtifactDependencies(Set<Artifact> artifactDependencies)

getArtifactDependencies

public Set<Artifact> getArtifactDependencies()

getLocalRepository

public ArtifactRepository getLocalRepository()
Description copied from interface: RepositoryRequest
Gets the local repository to use.

Specified by:
getLocalRepository in interface RepositoryRequest
Returns:
The local repository to use or null if not set.

setLocalRepository

public ArtifactResolutionRequest setLocalRepository(ArtifactRepository localRepository)
Description copied from interface: RepositoryRequest
Sets the local repository to use.

Specified by:
setLocalRepository in interface RepositoryRequest
Parameters:
localRepository - The local repository to use.
Returns:
This request, never null.

getRemoteRepositories

public List<ArtifactRepository> getRemoteRepositories()
Description copied from interface: RepositoryRequest
Gets the remote repositories to use.

Specified by:
getRemoteRepositories in interface RepositoryRequest
Returns:
The remote repositories to use, never null.

setRemoteRepositories

public ArtifactResolutionRequest setRemoteRepositories(List<ArtifactRepository> remoteRepositories)
Description copied from interface: RepositoryRequest
Sets the remote repositories to use.

Specified by:
setRemoteRepositories in interface RepositoryRequest
Parameters:
remoteRepositories - The remote repositories to use.
Returns:
This request, never null.

getCollectionFilter

public ArtifactFilter getCollectionFilter()
Gets the artifact filter that controls traversal of the dependency graph.

Returns:
The filter used to determine which of the artifacts in the dependency graph should be traversed or null to collect all transitive dependencies.

setCollectionFilter

public ArtifactResolutionRequest setCollectionFilter(ArtifactFilter filter)

getResolutionFilter

public ArtifactFilter getResolutionFilter()
Gets the artifact filter that controls downloading of artifact files. This filter operates on those artifacts that have been included by the getCollectionFilter().

Returns:
The filter used to determine which of the artifacts should have their files resolved or null to resolve the files for all collected artifacts.

setResolutionFilter

public ArtifactResolutionRequest setResolutionFilter(ArtifactFilter filter)

getListeners

public List<ResolutionListener> getListeners()

setListeners

public ArtifactResolutionRequest setListeners(List<ResolutionListener> listeners)

addListener

public ArtifactResolutionRequest addListener(ResolutionListener listener)

getManagedVersionMap

public Map<String,Artifact> getManagedVersionMap()

setManagedVersionMap

public ArtifactResolutionRequest setManagedVersionMap(Map<String,Artifact> managedVersionMap)

setResolveRoot

public ArtifactResolutionRequest setResolveRoot(boolean resolveRoot)

isResolveRoot

public boolean isResolveRoot()

setResolveTransitively

public ArtifactResolutionRequest setResolveTransitively(boolean resolveDependencies)

isResolveTransitively

public boolean isResolveTransitively()

toString

public String toString()
Overrides:
toString in class Object

isOffline

public boolean isOffline()
Description copied from interface: RepositoryRequest
Indicates whether network access to remote repositories has been disabled.

Specified by:
isOffline in interface RepositoryRequest
Returns:
true if remote access has been disabled, false otherwise.

setOffline

public ArtifactResolutionRequest setOffline(boolean offline)
Description copied from interface: RepositoryRequest
Enables/disables network access to remote repositories.

Specified by:
setOffline in interface RepositoryRequest
Parameters:
offline - true to disable remote access, false to allow network access.
Returns:
This request, never null.

isForceUpdate

public boolean isForceUpdate()
Description copied from interface: RepositoryRequest
Indicates whether remote repositories should be re-checked for updated artifacts/metadata regardless of their configured update policy.

Specified by:
isForceUpdate in interface RepositoryRequest
Returns:
true if remote repositories should be re-checked for updated artifacts/metadata, false otherwise.

setForceUpdate

public ArtifactResolutionRequest setForceUpdate(boolean forceUpdate)
Description copied from interface: RepositoryRequest
Enables/disabled forced checks for updated artifacts/metadata on remote repositories.

Specified by:
setForceUpdate in interface RepositoryRequest
Parameters:
forceUpdate - true to forcibly check the remote repositories for updated artifacts/metadata, false to use the update policy configured on each repository.
Returns:
This request, never null.

setServers

public ArtifactResolutionRequest setServers(List<Server> servers)

getServers

public List<Server> getServers()

setMirrors

public ArtifactResolutionRequest setMirrors(List<Mirror> mirrors)

getMirrors

public List<Mirror> getMirrors()

setProxies

public ArtifactResolutionRequest setProxies(List<Proxy> proxies)

getProxies

public List<Proxy> getProxies()

setCache

public ArtifactResolutionRequest setCache(RepositoryCache cache)


Copyright © 2001–2013 The Apache Software Foundation. All rights reserved.