org.apache.maven.plugin.assembly.artifact
Interface DependencyResolver

All Known Implementing Classes:
DefaultDependencyResolver

public interface DependencyResolver

Convenience component that aids in the resolution of dependency artifacts, according to various configurations such as transitivity flag and scope.

Version:
$Id: DependencyResolver.java 728546 2008-12-21 22:56:51Z bentmann $

Method Summary
 Map buildManagedVersionMap(Assembly assembly, AssemblerConfigurationSource configSource)
          Traverse the assembly descriptor to determine which scopes, modules, etc.
 Set resolveDependencies(org.apache.maven.project.MavenProject project, String scope, Map managedVersions, org.apache.maven.artifact.repository.ArtifactRepository localRepository, List remoteRepositories, boolean resolveTransitively)
          Resolve the project dependencies, according to the supplied configuration.
 

Method Detail

resolveDependencies

Set resolveDependencies(org.apache.maven.project.MavenProject project,
                        String scope,
                        Map managedVersions,
                        org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                        List remoteRepositories,
                        boolean resolveTransitively)
                        throws org.apache.maven.project.artifact.InvalidDependencyVersionException,
                               org.apache.maven.artifact.resolver.ArtifactResolutionException,
                               org.apache.maven.artifact.resolver.ArtifactNotFoundException
Resolve the project dependencies, according to the supplied configuration.

Parameters:
project - The project whose dependencies should be resolved
scope - The dependency scope to resolve
managedVersions - The map of managed versions, which allows dependency version conflict resolution to happen once for the entire assembly process.
localRepository - The local repository which acts as a local cache for remote artifact repositories
remoteRepositories - The list of remote ArtifactRepository instances to use during resolution, in addition to those defined in the supplied MavenProject instance.
resolveTransitively - If true, resolve project dependencies transitively; if false, only resolve the project's direct dependencies.
Returns:
The set of resolved Artifact instances for the project
Throws:
org.apache.maven.project.artifact.InvalidDependencyVersionException
org.apache.maven.artifact.resolver.ArtifactResolutionException
org.apache.maven.artifact.resolver.ArtifactNotFoundException

buildManagedVersionMap

Map buildManagedVersionMap(Assembly assembly,
                           AssemblerConfigurationSource configSource)
                           throws ArchiveCreationException,
                                  org.apache.maven.artifact.versioning.InvalidVersionSpecificationException,
                                  org.apache.maven.project.artifact.InvalidDependencyVersionException,
                                  org.apache.maven.artifact.resolver.ArtifactResolutionException
Traverse the assembly descriptor to determine which scopes, modules, etc. will require dependency resolution. Once we have a complete picture of what will be required in the way of resolution, feed all of this into the ArtifactCollector to discover/resolve versions for all dependencies in the mix, then save these versions in a mapping of:
Artifact.getDependencyConflictId() -> Artifact
This allows dependency conflict resolution to happen a single time, then be reused multiple times during the construction of the assembly archive.

Throws:
ArchiveCreationException
org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
org.apache.maven.project.artifact.InvalidDependencyVersionException
org.apache.maven.artifact.resolver.ArtifactResolutionException


Copyright © 2002-2012 Apache Software Foundation. All Rights Reserved.