public interface DependencyService
Provides all of the dependency management services. The main workflow for managing dependencies is:
1. Download and parse all of the AMD (AbstractArtifact Meta Data) files to build a dependency graph. 2. Traverse the graph and verify that it is a valid graph (doesn't contain conflicting versions of specific artifacts) 3. Traverse the graph and download the dependencies
Modifier and Type | Interface and Description |
---|---|
static class |
DependencyService.TraversalRules
Controls how resolution functions for each dependency-group.
|
Modifier and Type | Method and Description |
---|---|
DependencyGraph |
buildGraph(ReifiedArtifact project,
Dependencies dependencies,
Workflow workflow)
Builds a dependency graph for the given dependencies of the given project.
|
void |
publish(Publication publication,
PublishWorkflow workflow)
Publishes the given Publication (artifact, meta-data, source file, etc) with the given workflow.
|
ArtifactGraph |
reduce(DependencyGraph graph)
Reduces the DependencyGraph by ensuring that each dependency only has one version.
|
ResolvedArtifactGraph |
resolve(ArtifactGraph graph,
Workflow workflow,
DependencyService.TraversalRules rules,
DependencyListener... listeners)
Resolves the graph by downloading the artifacts.
|
DependencyGraph buildGraph(ReifiedArtifact project, Dependencies dependencies, Workflow workflow) throws ArtifactMetaDataMissingException, ProcessFailureException, org.savantbuild.security.MD5Exception
project
- The artifact that represents the project.dependencies
- The declared dependencies of the project.workflow
- The workflow to use for downloading and caching the AMD files.ArtifactMetaDataMissingException
- If any artifacts AMD files could not be downloaded or found locally.ProcessFailureException
- If a workflow process failed while fetching the meta-data.org.savantbuild.security.MD5Exception
- If any MD5 files didn't match the AMD file when downloading.void publish(Publication publication, PublishWorkflow workflow) throws PublishException
publication
- The publication to publish.workflow
- The workflow to publish with.PublishException
- If the publication failed.ArtifactGraph reduce(DependencyGraph graph) throws CompatibilityException, org.savantbuild.util.CyclicException
graph
- The dependency graph.CompatibilityException
- If an dependency has incompatible versions.org.savantbuild.util.CyclicException
- If the graph has a cycle in it.ResolvedArtifactGraph resolve(ArtifactGraph graph, Workflow workflow, DependencyService.TraversalRules rules, DependencyListener... listeners) throws org.savantbuild.util.CyclicException, ArtifactMissingException, ProcessFailureException, org.savantbuild.security.MD5Exception, LicenseException
reduce(DependencyGraph)
method.graph
- The ArtifactGraph to resolve.workflow
- The workflow used to resolve the artifacts.listeners
- Any listeners that want to receive callbacks when artifacts are resolved.rules
- The traversal rules that are applied while traversing the graph during the reduction.ProcessFailureException
- If a workflow process failed while fetching an artifact or its source.ArtifactMissingException
- If any of the required artifacts are missing.org.savantbuild.util.CyclicException
- If any of the artifact graph has any cycles in it.org.savantbuild.security.MD5Exception
- If the item's MD5 file did not match the item.LicenseException
- If an invalid license is encountered during the resolution process.