org.sonatype.aether
Interface RepositorySystem

All Known Implementing Classes:
DefaultRepositorySystem

public interface RepositorySystem

The main entry point to the repository system.

Author:
Benjamin Bentmann

Method Summary
 CollectResult collectDependencies(RepositorySystemSession session, CollectRequest request)
          Collects the transitive dependencies of an artifact and builds a dependency graph.
 DeployResult deploy(RepositorySystemSession session, DeployRequest request)
          Uploads a collection of artifacts and their accompanying metadata to a remote repository.
 InstallResult install(RepositorySystemSession session, InstallRequest request)
          Installs a collection of artifacts and their accompanying metadata to the local repository.
 LocalRepositoryManager newLocalRepositoryManager(LocalRepository localRepository)
          Creates a new manager for the specified local repository.
 SyncContext newSyncContext(RepositorySystemSession session, boolean shared)
          Creates a new synchronization context.
 ArtifactDescriptorResult readArtifactDescriptor(RepositorySystemSession session, ArtifactDescriptorRequest request)
          Gets information about an artifact like its direct dependencies and potential relocations.
 ArtifactResult resolveArtifact(RepositorySystemSession session, ArtifactRequest request)
          Resolves the paths for an artifact.
 List<ArtifactResult> resolveArtifacts(RepositorySystemSession session, Collection<? extends ArtifactRequest> requests)
          Resolves the paths for a collection of artifacts.
 List<ArtifactResult> resolveDependencies(RepositorySystemSession session, CollectRequest request, DependencyFilter filter)
          Deprecated. As of version 1.11, use resolveDependencies(RepositorySystemSession, DependencyRequest) instead.
 List<ArtifactResult> resolveDependencies(RepositorySystemSession session, DependencyNode node, DependencyFilter filter)
          Deprecated. As of version 1.11, use resolveDependencies(RepositorySystemSession, DependencyRequest) instead.
 DependencyResult resolveDependencies(RepositorySystemSession session, DependencyRequest request)
          Collects and resolves the transitive dependencies of an artifact.
 List<MetadataResult> resolveMetadata(RepositorySystemSession session, Collection<? extends MetadataRequest> requests)
          Resolves the paths for a collection of metadata.
 VersionResult resolveVersion(RepositorySystemSession session, VersionRequest request)
          Resolves an artifact's meta version (if any) to a concrete version.
 VersionRangeResult resolveVersionRange(RepositorySystemSession session, VersionRangeRequest request)
          Expands a version range to a list of matching versions, in ascending order.
 

Method Detail

resolveVersionRange

VersionRangeResult resolveVersionRange(RepositorySystemSession session,
                                       VersionRangeRequest request)
                                       throws VersionRangeResolutionException
Expands a version range to a list of matching versions, in ascending order. For example, resolves "[3.8,4.0)" to ["3.8", "3.8.1", "3.8.2"].

Parameters:
session - The repository session, must not be null.
request - The version range request, must not be null
Returns:
The version range result, never null.
Throws:
VersionRangeResolutionException - If the requested range could not be parsed. Note that an empty range does not raise an exception.

resolveVersion

VersionResult resolveVersion(RepositorySystemSession session,
                             VersionRequest request)
                             throws VersionResolutionException
Resolves an artifact's meta version (if any) to a concrete version. For example, resolves "1.0-SNAPSHOT" to "1.0-20090208.132618-23".

Parameters:
session - The repository session, must not be null.
request - The version request, must not be null
Returns:
The version result, never null.
Throws:
VersionResolutionException - If the metaversion could not be resolved.

readArtifactDescriptor

ArtifactDescriptorResult readArtifactDescriptor(RepositorySystemSession session,
                                                ArtifactDescriptorRequest request)
                                                throws ArtifactDescriptorException
Gets information about an artifact like its direct dependencies and potential relocations.

Parameters:
session - The repository session, must not be null.
request - The descriptor request, must not be null
Returns:
The descriptor result, never null.
Throws:
ArtifactDescriptorException - If the artifact descriptor could not be read.
See Also:
RepositorySystemSession.isIgnoreInvalidArtifactDescriptor(), RepositorySystemSession.isIgnoreMissingArtifactDescriptor()

collectDependencies

CollectResult collectDependencies(RepositorySystemSession session,
                                  CollectRequest request)
                                  throws DependencyCollectionException
Collects the transitive dependencies of an artifact and builds a dependency graph. Note that this operation is only concerned about determining the coordinates of the transitive dependencies. To also resolve the actual artifact files, use resolveDependencies(RepositorySystemSession, DependencyRequest).

Parameters:
session - The repository session, must not be null.
request - The collection request, must not be null
Returns:
The collection result, never null.
Throws:
DependencyCollectionException - If the dependency tree could not be built.
See Also:
RepositorySystemSession.getDependencyTraverser(), RepositorySystemSession.getDependencyManager(), RepositorySystemSession.getDependencySelector(), RepositorySystemSession.getDependencyGraphTransformer()

resolveDependencies

DependencyResult resolveDependencies(RepositorySystemSession session,
                                     DependencyRequest request)
                                     throws DependencyResolutionException
Collects and resolves the transitive dependencies of an artifact. This operation is essentially a combination of collectDependencies(RepositorySystemSession, CollectRequest) and resolveArtifacts(RepositorySystemSession, Collection).

Parameters:
session - The repository session, must not be null.
request - The dependency request, must not be null
Returns:
The dependency result, never null.
Throws:
DependencyResolutionException - If the dependency tree could not be built or any dependency artifact could not be resolved.

resolveDependencies

@Deprecated
List<ArtifactResult> resolveDependencies(RepositorySystemSession session,
                                                    DependencyNode node,
                                                    DependencyFilter filter)
                                         throws ArtifactResolutionException
Deprecated. As of version 1.11, use resolveDependencies(RepositorySystemSession, DependencyRequest) instead.

Resolves the paths for the artifacts referenced by the specified dependency graph. The dependency graph will be updated to reflect each successfully resolved artifact. Artifacts will be downloaded if necessary. Artifacts that are already resolved will be skipped and are not re-resolved.

Parameters:
session - The repository session, must not be null.
node - The root node of the dependency graph whose artifacts shall be resolved, must not be null
filter - The node filter to use to select the actual nodes to resolve, may be null to resolve all nodes.
Returns:
The resolution results, never null.
Throws:
ArtifactResolutionException - If any artifact could not be resolved.
See Also:
Artifact.getFile()

resolveDependencies

@Deprecated
List<ArtifactResult> resolveDependencies(RepositorySystemSession session,
                                                    CollectRequest request,
                                                    DependencyFilter filter)
                                         throws DependencyCollectionException,
                                                ArtifactResolutionException
Deprecated. As of version 1.11, use resolveDependencies(RepositorySystemSession, DependencyRequest) instead.

Collects the transitive dependencies of an artifact and resolves the paths for the artifacts referenced by the specified dependency graph. This is a convenience method that combines collectDependencies(RepositorySystemSession, CollectRequest) and resolveDependencies(RepositorySystemSession, DependencyNode, DependencyFilter).

Parameters:
session - The repository session, must not be null.
request - The collection request, must not be null
filter - The node filter to use to select the actual nodes to resolve, may be null to resolve all nodes.
Returns:
The resolution results, never null.
Throws:
DependencyCollectionException - If the dependency tree could not be built.
ArtifactResolutionException - If any artifact could not be resolved.

resolveArtifact

ArtifactResult resolveArtifact(RepositorySystemSession session,
                               ArtifactRequest request)
                               throws ArtifactResolutionException
Resolves the paths for an artifact. The artifact will be downloaded if necessary. An artifacts that is already resolved will be skipped and is not re-resolved. Note that this method assumes that any relocations have already been processed.

Parameters:
session - The repository session, must not be null.
request - The resolution request, must not be null
Returns:
The resolution result, never null.
Throws:
ArtifactResolutionException - If the artifact could not be resolved.
See Also:
Artifact.getFile()

resolveArtifacts

List<ArtifactResult> resolveArtifacts(RepositorySystemSession session,
                                      Collection<? extends ArtifactRequest> requests)
                                      throws ArtifactResolutionException
Resolves the paths for a collection of artifacts. Artifacts will be downloaded if necessary. Artifacts that are already resolved will be skipped and are not re-resolved. Note that this method assumes that any relocations have already been processed.

Parameters:
session - The repository session, must not be null.
requests - The resolution requests, must not be null
Returns:
The resolution results (in request order), never null.
Throws:
ArtifactResolutionException - If any artifact could not be resolved.
See Also:
Artifact.getFile()

resolveMetadata

List<MetadataResult> resolveMetadata(RepositorySystemSession session,
                                     Collection<? extends MetadataRequest> requests)
Resolves the paths for a collection of metadata. Metadata will be downloaded if necessary.

Parameters:
session - The repository session, must not be null.
requests - The resolution requests, must not be null
Returns:
The resolution results (in request order), never null.
See Also:
Metadata.getFile()

install

InstallResult install(RepositorySystemSession session,
                      InstallRequest request)
                      throws InstallationException
Installs a collection of artifacts and their accompanying metadata to the local repository.

Parameters:
session - The repository session, must not be null.
request - The installation request, must not be null.
Returns:
The installation result, never null.
Throws:
InstallationException - If any artifact/metadata from the request could not be installed.

deploy

DeployResult deploy(RepositorySystemSession session,
                    DeployRequest request)
                    throws DeploymentException
Uploads a collection of artifacts and their accompanying metadata to a remote repository.

Parameters:
session - The repository session, must not be null.
request - The deployment request, must not be null.
Returns:
The deployment result, never null.
Throws:
DeploymentException - If any artifact/metadata from the request could not be deployed.

newLocalRepositoryManager

LocalRepositoryManager newLocalRepositoryManager(LocalRepository localRepository)
Creates a new manager for the specified local repository. If the specified local repository has no type, the default repository type will be used.

Parameters:
localRepository - The local repository to create a manager for, must not be null.
Returns:
The local repository manager, never null.
Throws:
IllegalArgumentException - If the specified repository type is not recognized or no base directory is given.

newSyncContext

SyncContext newSyncContext(RepositorySystemSession session,
                           boolean shared)
Creates a new synchronization context.

Parameters:
session - The repository session during which the context will be used, must not be null.
shared - A flag indicating whether access to the artifacts/metadata associated with the new context can be shared among concurrent readers or whether access needs to be exclusive to the calling thread.
Returns:
The synchronization context, never null.


Copyright © 2010-2013. All Rights Reserved.