Package org.eclipse.aether.internal.impl
Class DefaultRepositorySystem
- java.lang.Object
-
- org.eclipse.aether.internal.impl.DefaultRepositorySystem
-
- All Implemented Interfaces:
RepositorySystem
,Service
@Named public class DefaultRepositorySystem extends Object implements RepositorySystem, Service
-
-
Constructor Summary
Constructors Constructor Description DefaultRepositorySystem()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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.void
initService(ServiceLocator locator)
Provides the opportunity to initialize this service and to acquire other services for its operation from the locator.InstallResult
install(RepositorySystemSession session, InstallRequest request)
Installs a collection of artifacts and their accompanying metadata to the local repository.RemoteRepository
newDeploymentRepository(RepositorySystemSession session, RemoteRepository repository)
Forms a remote repository suitable for artifact deployment by applying the session's authentication selector and similar network configuration to the given repository prototype.LocalRepositoryManager
newLocalRepositoryManager(RepositorySystemSession session, LocalRepository localRepository)
Creates a new manager for the specified local repository.List<RemoteRepository>
newResolutionRepositories(RepositorySystemSession session, List<RemoteRepository> repositories)
Forms remote repositories suitable for artifact resolution by applying the session's authentication selector and similar network configuration to the given repository prototypes.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 path for an artifact.List<ArtifactResult>
resolveArtifacts(RepositorySystemSession session, Collection<? extends ArtifactRequest> requests)
Resolves the paths for a collection of artifacts.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.DefaultRepositorySystem
setArtifactDescriptorReader(ArtifactDescriptorReader artifactDescriptorReader)
DefaultRepositorySystem
setArtifactResolver(ArtifactResolver artifactResolver)
DefaultRepositorySystem
setDependencyCollector(DependencyCollector dependencyCollector)
DefaultRepositorySystem
setDeployer(Deployer deployer)
DefaultRepositorySystem
setInstaller(Installer installer)
DefaultRepositorySystem
setLocalRepositoryProvider(LocalRepositoryProvider localRepositoryProvider)
DefaultRepositorySystem
setLoggerFactory(LoggerFactory loggerFactory)
Deprecated.not used any more since MRESOLVER-36 move to slf4j, added back in MRESOLVER-64 for compatibilityDefaultRepositorySystem
setMetadataResolver(MetadataResolver metadataResolver)
DefaultRepositorySystem
setRemoteRepositoryManager(RemoteRepositoryManager remoteRepositoryManager)
DefaultRepositorySystem
setSyncContextFactory(SyncContextFactory syncContextFactory)
DefaultRepositorySystem
setVersionRangeResolver(VersionRangeResolver versionRangeResolver)
DefaultRepositorySystem
setVersionResolver(VersionResolver versionResolver)
-
-
-
Constructor Detail
-
DefaultRepositorySystem
public DefaultRepositorySystem()
-
-
Method Detail
-
initService
public void initService(ServiceLocator locator)
Description copied from interface:Service
Provides the opportunity to initialize this service and to acquire other services for its operation from the locator. A service must not save the reference to the provided service locator.- Specified by:
initService
in interfaceService
- Parameters:
locator
- The service locator, must not benull
.
-
setLoggerFactory
@Deprecated public DefaultRepositorySystem setLoggerFactory(LoggerFactory loggerFactory)
Deprecated.not used any more since MRESOLVER-36 move to slf4j, added back in MRESOLVER-64 for compatibility
-
setVersionResolver
public DefaultRepositorySystem setVersionResolver(VersionResolver versionResolver)
-
setVersionRangeResolver
public DefaultRepositorySystem setVersionRangeResolver(VersionRangeResolver versionRangeResolver)
-
setArtifactResolver
public DefaultRepositorySystem setArtifactResolver(ArtifactResolver artifactResolver)
-
setMetadataResolver
public DefaultRepositorySystem setMetadataResolver(MetadataResolver metadataResolver)
-
setArtifactDescriptorReader
public DefaultRepositorySystem setArtifactDescriptorReader(ArtifactDescriptorReader artifactDescriptorReader)
-
setDependencyCollector
public DefaultRepositorySystem setDependencyCollector(DependencyCollector dependencyCollector)
-
setInstaller
public DefaultRepositorySystem setInstaller(Installer installer)
-
setDeployer
public DefaultRepositorySystem setDeployer(Deployer deployer)
-
setLocalRepositoryProvider
public DefaultRepositorySystem setLocalRepositoryProvider(LocalRepositoryProvider localRepositoryProvider)
-
setSyncContextFactory
public DefaultRepositorySystem setSyncContextFactory(SyncContextFactory syncContextFactory)
-
setRemoteRepositoryManager
public DefaultRepositorySystem setRemoteRepositoryManager(RemoteRepositoryManager remoteRepositoryManager)
-
resolveVersion
public VersionResult resolveVersion(RepositorySystemSession session, VersionRequest request) throws VersionResolutionException
Description copied from interface:RepositorySystem
Resolves an artifact's meta version (if any) to a concrete version. For example, resolves "1.0-SNAPSHOT" to "1.0-20090208.132618-23".- Specified by:
resolveVersion
in interfaceRepositorySystem
- Parameters:
session
- The repository session, must not benull
.request
- The version request, must not benull
.- Returns:
- The version result, never
null
. - Throws:
VersionResolutionException
- If the metaversion could not be resolved.- See Also:
RepositorySystem.newResolutionRepositories(RepositorySystemSession, List)
-
resolveVersionRange
public VersionRangeResult resolveVersionRange(RepositorySystemSession session, VersionRangeRequest request) throws VersionRangeResolutionException
Description copied from interface:RepositorySystem
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". Note that the returned list of versions is only dependent on the configured repositories and their contents, the list is not processed by thesession's version filter
.The supplied request may also refer to a single concrete version rather than a version range. In this case though, the result contains simply the (parsed) input version, regardless of the repositories and their contents.
- Specified by:
resolveVersionRange
in interfaceRepositorySystem
- Parameters:
session
- The repository session, must not benull
.request
- The version range request, must not benull
.- 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.- See Also:
RepositorySystem.newResolutionRepositories(RepositorySystemSession, List)
-
readArtifactDescriptor
public ArtifactDescriptorResult readArtifactDescriptor(RepositorySystemSession session, ArtifactDescriptorRequest request) throws ArtifactDescriptorException
Description copied from interface:RepositorySystem
Gets information about an artifact like its direct dependencies and potential relocations.- Specified by:
readArtifactDescriptor
in interfaceRepositorySystem
- Parameters:
session
- The repository session, must not benull
.request
- The descriptor request, must not benull
.- Returns:
- The descriptor result, never
null
. - Throws:
ArtifactDescriptorException
- If the artifact descriptor could not be read.- See Also:
RepositorySystemSession.getArtifactDescriptorPolicy()
,RepositorySystem.newResolutionRepositories(RepositorySystemSession, List)
-
resolveArtifact
public ArtifactResult resolveArtifact(RepositorySystemSession session, ArtifactRequest request) throws ArtifactResolutionException
Description copied from interface:RepositorySystem
Resolves the path for an artifact. The artifact will be downloaded to the local repository if necessary. An artifact that is already resolved will be skipped and is not re-resolved. In general, callers must not assume any relationship between an artifact's resolved filename and its coordinates. Note that this method assumes that any relocations have already been processed.- Specified by:
resolveArtifact
in interfaceRepositorySystem
- Parameters:
session
- The repository session, must not benull
.request
- The resolution request, must not benull
.- Returns:
- The resolution result, never
null
. - Throws:
ArtifactResolutionException
- If the artifact could not be resolved.- See Also:
Artifact.getFile()
,RepositorySystem.newResolutionRepositories(RepositorySystemSession, List)
-
resolveArtifacts
public List<ArtifactResult> resolveArtifacts(RepositorySystemSession session, Collection<? extends ArtifactRequest> requests) throws ArtifactResolutionException
Description copied from interface:RepositorySystem
Resolves the paths for a collection of artifacts. Artifacts will be downloaded to the local repository if necessary. Artifacts that are already resolved will be skipped and are not re-resolved. In general, callers must not assume any relationship between an artifact's filename and its coordinates. Note that this method assumes that any relocations have already been processed.- Specified by:
resolveArtifacts
in interfaceRepositorySystem
- Parameters:
session
- The repository session, must not benull
.requests
- The resolution requests, must not benull
.- Returns:
- The resolution results (in request order), never
null
. - Throws:
ArtifactResolutionException
- If any artifact could not be resolved.- See Also:
Artifact.getFile()
,RepositorySystem.newResolutionRepositories(RepositorySystemSession, List)
-
resolveMetadata
public List<MetadataResult> resolveMetadata(RepositorySystemSession session, Collection<? extends MetadataRequest> requests)
Description copied from interface:RepositorySystem
Resolves the paths for a collection of metadata. Metadata will be downloaded to the local repository if necessary, e.g. because it hasn't been cached yet or the cache is deemed outdated.- Specified by:
resolveMetadata
in interfaceRepositorySystem
- Parameters:
session
- The repository session, must not benull
.requests
- The resolution requests, must not benull
.- Returns:
- The resolution results (in request order), never
null
. - See Also:
Metadata.getFile()
,RepositorySystem.newResolutionRepositories(RepositorySystemSession, List)
-
collectDependencies
public CollectResult collectDependencies(RepositorySystemSession session, CollectRequest request) throws DependencyCollectionException
Description copied from interface:RepositorySystem
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, useRepositorySystem.resolveDependencies(RepositorySystemSession, DependencyRequest)
.- Specified by:
collectDependencies
in interfaceRepositorySystem
- Parameters:
session
- The repository session, must not benull
.request
- The collection request, must not benull
.- 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.getVersionFilter()
,RepositorySystemSession.getDependencyGraphTransformer()
,RepositorySystem.newResolutionRepositories(RepositorySystemSession, List)
-
resolveDependencies
public DependencyResult resolveDependencies(RepositorySystemSession session, DependencyRequest request) throws DependencyResolutionException
Description copied from interface:RepositorySystem
Collects and resolves the transitive dependencies of an artifact. This operation is essentially a combination ofRepositorySystem.collectDependencies(RepositorySystemSession, CollectRequest)
andRepositorySystem.resolveArtifacts(RepositorySystemSession, Collection)
.- Specified by:
resolveDependencies
in interfaceRepositorySystem
- Parameters:
session
- The repository session, must not benull
.request
- The dependency request, must not benull
.- Returns:
- The dependency result, never
null
. - Throws:
DependencyResolutionException
- If the dependency tree could not be built or any dependency artifact could not be resolved.- See Also:
RepositorySystem.newResolutionRepositories(RepositorySystemSession, List)
-
install
public InstallResult install(RepositorySystemSession session, InstallRequest request) throws InstallationException
Description copied from interface:RepositorySystem
Installs a collection of artifacts and their accompanying metadata to the local repository.- Specified by:
install
in interfaceRepositorySystem
- Parameters:
session
- The repository session, must not benull
.request
- The installation request, must not benull
.- Returns:
- The installation result, never
null
. - Throws:
InstallationException
- If any artifact/metadata from the request could not be installed.
-
deploy
public DeployResult deploy(RepositorySystemSession session, DeployRequest request) throws DeploymentException
Description copied from interface:RepositorySystem
Uploads a collection of artifacts and their accompanying metadata to a remote repository.- Specified by:
deploy
in interfaceRepositorySystem
- Parameters:
session
- The repository session, must not benull
.request
- The deployment request, must not benull
.- Returns:
- The deployment result, never
null
. - Throws:
DeploymentException
- If any artifact/metadata from the request could not be deployed.- See Also:
RepositorySystem.newDeploymentRepository(RepositorySystemSession, RemoteRepository)
-
newLocalRepositoryManager
public LocalRepositoryManager newLocalRepositoryManager(RepositorySystemSession session, LocalRepository localRepository)
Description copied from interface:RepositorySystem
Creates a new manager for the specified local repository. If the specified local repository has no type, the default local repository type of the system will be used. Note: It is expected that this method invocation is one of the last steps of setting up a new session, in particular any configuration properties should have been set already.- Specified by:
newLocalRepositoryManager
in interfaceRepositorySystem
- Parameters:
session
- The repository system session from which to configure the manager, must not benull
.localRepository
- The local repository to create a manager for, must not benull
.- Returns:
- The local repository manager, never
null
.
-
newSyncContext
public SyncContext newSyncContext(RepositorySystemSession session, boolean shared)
Description copied from interface:RepositorySystem
Creates a new synchronization context.- Specified by:
newSyncContext
in interfaceRepositorySystem
- Parameters:
session
- The repository session during which the context will be used, must not benull
.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
.
-
newResolutionRepositories
public List<RemoteRepository> newResolutionRepositories(RepositorySystemSession session, List<RemoteRepository> repositories)
Description copied from interface:RepositorySystem
Forms remote repositories suitable for artifact resolution by applying the session's authentication selector and similar network configuration to the given repository prototypes. As noted forRepositorySystemSession.getAuthenticationSelector()
etc. the remote repositories passed to e.g.resolveArtifact()
are used as is and expected to already carry any required authentication or proxy configuration. This method can be used to apply the authentication/proxy configuration from a session to a bare repository definition to obtain the complete repository definition for use in the resolution request.- Specified by:
newResolutionRepositories
in interfaceRepositorySystem
- Parameters:
session
- The repository system session from which to configure the repositories, must not benull
.repositories
- The repository prototypes from which to derive the resolution repositories, must not benull
or containnull
elements.- Returns:
- The resolution repositories, never
null
. Note that there is generally no 1:1 relationship of the obtained repositories to the original inputs due to mirror selection potentially aggregating multiple repositories. - See Also:
RepositorySystem.newDeploymentRepository(RepositorySystemSession, RemoteRepository)
-
newDeploymentRepository
public RemoteRepository newDeploymentRepository(RepositorySystemSession session, RemoteRepository repository)
Description copied from interface:RepositorySystem
Forms a remote repository suitable for artifact deployment by applying the session's authentication selector and similar network configuration to the given repository prototype. As noted forRepositorySystemSession.getAuthenticationSelector()
etc. the remote repository passed todeploy()
is used as is and expected to already carry any required authentication or proxy configuration. This method can be used to apply the authentication/proxy configuration from a session to a bare repository definition to obtain the complete repository definition for use in the deploy request.- Specified by:
newDeploymentRepository
in interfaceRepositorySystem
- Parameters:
session
- The repository system session from which to configure the repository, must not benull
.repository
- The repository prototype from which to derive the deployment repository, must not benull
.- Returns:
- The deployment repository, never
null
. - See Also:
RepositorySystem.newResolutionRepositories(RepositorySystemSession, List)
-
-