Class TestRepositorySystemSession
- All Implemented Interfaces:
org.eclipse.aether.RepositorySystemSession
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.aether.RepositorySystemSession
org.eclipse.aether.RepositorySystemSession.CloseableSession, org.eclipse.aether.RepositorySystemSession.SessionBuilder
-
Constructor Summary
ConstructorDescriptionTestRepositorySystemSession
(Consumer<Runnable> onSessionCloseConsumer) TestRepositorySystemSession
(org.eclipse.aether.RepositorySystemSession session) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addOnSessionEndedHandler
(Runnable handler) Registers onSessionEnded handler, if able to.org.eclipse.aether.resolution.ArtifactDescriptorPolicy
org.eclipse.aether.artifact.ArtifactTypeRegistry
org.eclipse.aether.repository.AuthenticationSelector
org.eclipse.aether.RepositoryCache
getCache()
org.eclipse.aether.SessionData
getData()
org.eclipse.aether.collection.DependencyGraphTransformer
org.eclipse.aether.collection.DependencyManager
org.eclipse.aether.collection.DependencySelector
org.eclipse.aether.collection.DependencyTraverser
org.eclipse.aether.repository.LocalRepository
org.eclipse.aether.repository.LocalRepositoryManager
org.eclipse.aether.repository.MirrorSelector
org.eclipse.aether.repository.ProxySelector
org.eclipse.aether.RepositoryListener
org.eclipse.aether.resolution.ResolutionErrorPolicy
org.eclipse.aether.transfer.TransferListener
org.eclipse.aether.collection.VersionFilter
org.eclipse.aether.repository.WorkspaceReader
boolean
boolean
setArtifactDescriptorPolicy
(org.eclipse.aether.resolution.ArtifactDescriptorPolicy artifactDescriptorPolicy) Sets the policy which controls how errors related to reading artifact descriptors should be handled.setArtifactTypeRegistry
(org.eclipse.aether.artifact.ArtifactTypeRegistry artifactTypeRegistry) Sets the registry of artifact types recognized by this session.setArtifactUpdatePolicy
(String artifactUpdatePolicy) Sets the global artifact update policy.setAuthenticationSelector
(org.eclipse.aether.repository.AuthenticationSelector authenticationSelector) Sets the authentication selector to use for repositories discovered in artifact descriptors.setCache
(org.eclipse.aether.RepositoryCache cache) Sets the cache the repository system may use to save data for future reuse during the session.setChecksumPolicy
(String checksumPolicy) Sets the global checksum policy.setConfigProperties
(Map<?, ?> configProperties) Sets the configuration properties used to tweak internal aspects of the repository system (e.g.setConfigProperty
(String key, Object value) Sets the specified configuration property.setData
(org.eclipse.aether.SessionData data) Sets the custom data associated with this session.setDependencyGraphTransformer
(org.eclipse.aether.collection.DependencyGraphTransformer dependencyGraphTransformer) Sets the dependency graph transformer to use for building dependency graphs.setDependencyManager
(org.eclipse.aether.collection.DependencyManager dependencyManager) Sets the dependency manager to use for building dependency graphs.setDependencySelector
(org.eclipse.aether.collection.DependencySelector dependencySelector) Sets the dependency selector to use for building dependency graphs.setDependencyTraverser
(org.eclipse.aether.collection.DependencyTraverser dependencyTraverser) Sets the dependency traverser to use for building dependency graphs.setIgnoreArtifactDescriptorRepositories
(boolean ignoreArtifactDescriptorRepositories) Controls whether repositories declared in artifact descriptors should be ignored during transitive dependency collection.setLocalRepositoryManager
(org.eclipse.aether.repository.LocalRepositoryManager localRepositoryManager) Sets the local repository manager used during this session.setMetadataUpdatePolicy
(String metadataUpdatePolicy) Sets the global metadata update policy.setMirrorSelector
(org.eclipse.aether.repository.MirrorSelector mirrorSelector) Sets the mirror selector to use for repositories discovered in artifact descriptors.setOffline
(boolean offline) Controls whether the repository system operates in offline mode and avoids/refuses any access to remote repositories.setProxySelector
(org.eclipse.aether.repository.ProxySelector proxySelector) Sets the proxy selector to use for repositories discovered in artifact descriptors.void
Marks this session as read-only such that any future attempts to call its mutators will fail with an exception.setRepositoryListener
(org.eclipse.aether.RepositoryListener repositoryListener) Sets the listener being notified of actions in the repository system.setResolutionErrorPolicy
(org.eclipse.aether.resolution.ResolutionErrorPolicy resolutionErrorPolicy) Sets the policy which controls whether resolutions errors from remote repositories should be cached.setSystemProperties
(Map<?, ?> systemProperties) Sets the system properties to use, e.g.setSystemProperty
(String key, String value) Sets the specified system property.setTransferListener
(org.eclipse.aether.transfer.TransferListener transferListener) Sets the listener being notified of uploads/downloads by the repository system.setUpdatePolicy
(String updatePolicy) Sets the global update policy.setUserProperties
(Map<?, ?> userProperties) Sets the user properties to use, e.g.setUserProperty
(String key, String value) Sets the specified user property.setVersionFilter
(org.eclipse.aether.collection.VersionFilter versionFilter) Sets the version filter to use for building dependency graphs.setWorkspaceReader
(org.eclipse.aether.repository.WorkspaceReader workspaceReader) Sets the workspace reader used during this session.
-
Constructor Details
-
TestRepositorySystemSession
-
TestRepositorySystemSession
-
-
Method Details
-
isOffline
- Specified by:
isOffline
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setOffline
Controls whether the repository system operates in offline mode and avoids/refuses any access to remote repositories.- Parameters:
offline
-true
if the repository system is in offline mode,false
otherwise.- Returns:
- This session for chaining, never
null
.
-
isIgnoreArtifactDescriptorRepositories
- Specified by:
isIgnoreArtifactDescriptorRepositories
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setIgnoreArtifactDescriptorRepositories
public TestRepositorySystemSession setIgnoreArtifactDescriptorRepositories(boolean ignoreArtifactDescriptorRepositories) Controls whether repositories declared in artifact descriptors should be ignored during transitive dependency collection. If enabled, only the repositories originally provided with the collect request will be considered.- Parameters:
ignoreArtifactDescriptorRepositories
-true
to ignore additional repositories from artifact descriptors,false
to merge those with the originally specified repositories.- Returns:
- This session for chaining, never
null
.
-
getResolutionErrorPolicy
- Specified by:
getResolutionErrorPolicy
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setResolutionErrorPolicy
public TestRepositorySystemSession setResolutionErrorPolicy(org.eclipse.aether.resolution.ResolutionErrorPolicy resolutionErrorPolicy) Sets the policy which controls whether resolutions errors from remote repositories should be cached.- Parameters:
resolutionErrorPolicy
- The resolution error policy for this session, may benull
if resolution errors should generally not be cached.- Returns:
- This session for chaining, never
null
.
-
getArtifactDescriptorPolicy
- Specified by:
getArtifactDescriptorPolicy
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setArtifactDescriptorPolicy
public TestRepositorySystemSession setArtifactDescriptorPolicy(org.eclipse.aether.resolution.ArtifactDescriptorPolicy artifactDescriptorPolicy) Sets the policy which controls how errors related to reading artifact descriptors should be handled.- Parameters:
artifactDescriptorPolicy
- The descriptor error policy for this session, may benull
if descriptor errors should generally not be tolerated.- Returns:
- This session for chaining, never
null
.
-
getChecksumPolicy
- Specified by:
getChecksumPolicy
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setChecksumPolicy
Sets the global checksum policy. If set, the global checksum policy overrides the checksum policies of the remote repositories being used for resolution.- Parameters:
checksumPolicy
- The global checksum policy, may benull
/empty to apply the per-repository policies.- Returns:
- This session for chaining, never
null
. - See Also:
-
getUpdatePolicy
- Specified by:
getUpdatePolicy
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setUpdatePolicy
Sets the global update policy. If set, the global update policy overrides the update policies of the remote repositories being used for resolution.This method is meant for code that does not want to distinguish between artifact and metadata policies. Note: applications should either use get/set updatePolicy (this method and
RepositorySystemSession.getUpdatePolicy()
) or also distinguish between artifact and metadata update policies (and use other methods), but should not mix the two!- Parameters:
updatePolicy
- The global update policy, may benull
/empty to apply the per-repository policies.- Returns:
- This session for chaining, never
null
. - See Also:
-
getArtifactUpdatePolicy
- Specified by:
getArtifactUpdatePolicy
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setArtifactUpdatePolicy
Sets the global artifact update policy. If set, the global update policy overrides the artifact update policies of the remote repositories being used for resolution.- Parameters:
artifactUpdatePolicy
- The global update policy, may benull
/empty to apply the per-repository policies.- Returns:
- This session for chaining, never
null
. - Since:
- 2.0.0
- See Also:
-
getMetadataUpdatePolicy
- Specified by:
getMetadataUpdatePolicy
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setMetadataUpdatePolicy
Sets the global metadata update policy. If set, the global update policy overrides the metadata update policies of the remote repositories being used for resolution.- Parameters:
metadataUpdatePolicy
- The global update policy, may benull
/empty to apply the per-repository policies.- Returns:
- This session for chaining, never
null
. - Since:
- 2.0.0
- See Also:
-
getLocalRepository
- Specified by:
getLocalRepository
in interfaceorg.eclipse.aether.RepositorySystemSession
-
getLocalRepositoryManager
- Specified by:
getLocalRepositoryManager
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setLocalRepositoryManager
public TestRepositorySystemSession setLocalRepositoryManager(org.eclipse.aether.repository.LocalRepositoryManager localRepositoryManager) Sets the local repository manager used during this session. Note: Eventually, a valid session must have a local repository manager set.- Parameters:
localRepositoryManager
- The local repository manager used during this session, may benull
.- Returns:
- This session for chaining, never
null
.
-
getWorkspaceReader
- Specified by:
getWorkspaceReader
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setWorkspaceReader
public TestRepositorySystemSession setWorkspaceReader(org.eclipse.aether.repository.WorkspaceReader workspaceReader) Sets the workspace reader used during this session. If set, the workspace reader will usually be consulted first to resolve artifacts.- Parameters:
workspaceReader
- The workspace reader for this session, may benull
if none.- Returns:
- This session for chaining, never
null
.
-
getRepositoryListener
- Specified by:
getRepositoryListener
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setRepositoryListener
public TestRepositorySystemSession setRepositoryListener(org.eclipse.aether.RepositoryListener repositoryListener) Sets the listener being notified of actions in the repository system.- Parameters:
repositoryListener
- The repository listener, may benull
if none.- Returns:
- This session for chaining, never
null
.
-
getTransferListener
- Specified by:
getTransferListener
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setTransferListener
public TestRepositorySystemSession setTransferListener(org.eclipse.aether.transfer.TransferListener transferListener) Sets the listener being notified of uploads/downloads by the repository system.- Parameters:
transferListener
- The transfer listener, may benull
if none.- Returns:
- This session for chaining, never
null
.
-
getSystemProperties
- Specified by:
getSystemProperties
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setSystemProperties
Sets the system properties to use, e.g. for processing of artifact descriptors. System properties are usually collected from the runtime environment likeSystem.getProperties()
and environment variables.Note: System properties are of type
Map<String, String>
and any key-value pair in the input map that doesn't match this type will be silently ignored.- Parameters:
systemProperties
- The system properties, may benull
or empty if none.- Returns:
- This session for chaining, never
null
.
-
setSystemProperty
Sets the specified system property.- Parameters:
key
- The property key, must not benull
.value
- The property value, may benull
to remove/unset the property.- Returns:
- This session for chaining, never
null
.
-
getUserProperties
- Specified by:
getUserProperties
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setUserProperties
Sets the user properties to use, e.g. for processing of artifact descriptors. User properties are similar to system properties but are set on the discretion of the user and hence are considered of higher priority than system properties in case of conflicts.Note: User properties are of type
Map<String, String>
and any key-value pair in the input map that doesn't match this type will be silently ignored.- Parameters:
userProperties
- The user properties, may benull
or empty if none.- Returns:
- This session for chaining, never
null
.
-
setUserProperty
Sets the specified user property.- Parameters:
key
- The property key, must not benull
.value
- The property value, may benull
to remove/unset the property.- Returns:
- This session for chaining, never
null
.
-
getConfigProperties
- Specified by:
getConfigProperties
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setConfigProperties
Sets the configuration properties used to tweak internal aspects of the repository system (e.g. thread pooling, connector-specific behavior, etc.).Note: Configuration properties are of type
Map<String, Object>
and any key-value pair in the input map that doesn't match this type will be silently ignored.- Parameters:
configProperties
- The configuration properties, may benull
or empty if none.- Returns:
- This session for chaining, never
null
.
-
setConfigProperty
Sets the specified configuration property.- Parameters:
key
- The property key, must not benull
.value
- The property value, may benull
to remove/unset the property.- Returns:
- This session for chaining, never
null
.
-
getMirrorSelector
- Specified by:
getMirrorSelector
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setMirrorSelector
public TestRepositorySystemSession setMirrorSelector(org.eclipse.aether.repository.MirrorSelector mirrorSelector) Sets the mirror selector to use for repositories discovered in artifact descriptors. Note that this selector is not used for remote repositories which are passed as request parameters to the repository system, those repositories are supposed to denote the effective repositories.- Parameters:
mirrorSelector
- The mirror selector to use, may benull
.- Returns:
- This session for chaining, never
null
.
-
getProxySelector
- Specified by:
getProxySelector
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setProxySelector
public TestRepositorySystemSession setProxySelector(org.eclipse.aether.repository.ProxySelector proxySelector) Sets the proxy selector to use for repositories discovered in artifact descriptors. Note that this selector is not used for remote repositories which are passed as request parameters to the repository system, those repositories are supposed to have their proxy (if any) already set.- Parameters:
proxySelector
- The proxy selector to use, may benull
.- Returns:
- This session for chaining, never
null
. - See Also:
-
getAuthenticationSelector
- Specified by:
getAuthenticationSelector
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setAuthenticationSelector
public TestRepositorySystemSession setAuthenticationSelector(org.eclipse.aether.repository.AuthenticationSelector authenticationSelector) Sets the authentication selector to use for repositories discovered in artifact descriptors. Note that this selector is not used for remote repositories which are passed as request parameters to the repository system, those repositories are supposed to have their authentication (if any) already set.- Parameters:
authenticationSelector
- The authentication selector to use, may benull
.- Returns:
- This session for chaining, never
null
. - See Also:
-
getArtifactTypeRegistry
- Specified by:
getArtifactTypeRegistry
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setArtifactTypeRegistry
public TestRepositorySystemSession setArtifactTypeRegistry(org.eclipse.aether.artifact.ArtifactTypeRegistry artifactTypeRegistry) Sets the registry of artifact types recognized by this session.- Parameters:
artifactTypeRegistry
- The artifact type registry, may benull
.- Returns:
- This session for chaining, never
null
.
-
getDependencyTraverser
- Specified by:
getDependencyTraverser
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setDependencyTraverser
public TestRepositorySystemSession setDependencyTraverser(org.eclipse.aether.collection.DependencyTraverser dependencyTraverser) Sets the dependency traverser to use for building dependency graphs.- Parameters:
dependencyTraverser
- The dependency traverser to use for building dependency graphs, may benull
.- Returns:
- This session for chaining, never
null
.
-
getDependencyManager
- Specified by:
getDependencyManager
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setDependencyManager
public TestRepositorySystemSession setDependencyManager(org.eclipse.aether.collection.DependencyManager dependencyManager) Sets the dependency manager to use for building dependency graphs.- Parameters:
dependencyManager
- The dependency manager to use for building dependency graphs, may benull
.- Returns:
- This session for chaining, never
null
.
-
getDependencySelector
- Specified by:
getDependencySelector
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setDependencySelector
public TestRepositorySystemSession setDependencySelector(org.eclipse.aether.collection.DependencySelector dependencySelector) Sets the dependency selector to use for building dependency graphs.- Parameters:
dependencySelector
- The dependency selector to use for building dependency graphs, may benull
.- Returns:
- This session for chaining, never
null
.
-
getVersionFilter
- Specified by:
getVersionFilter
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setVersionFilter
public TestRepositorySystemSession setVersionFilter(org.eclipse.aether.collection.VersionFilter versionFilter) Sets the version filter to use for building dependency graphs.- Parameters:
versionFilter
- The version filter to use for building dependency graphs, may benull
to not filter versions.- Returns:
- This session for chaining, never
null
.
-
getDependencyGraphTransformer
- Specified by:
getDependencyGraphTransformer
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setDependencyGraphTransformer
public TestRepositorySystemSession setDependencyGraphTransformer(org.eclipse.aether.collection.DependencyGraphTransformer dependencyGraphTransformer) Sets the dependency graph transformer to use for building dependency graphs.- Parameters:
dependencyGraphTransformer
- The dependency graph transformer to use for building dependency graphs, may benull
.- Returns:
- This session for chaining, never
null
.
-
getData
- Specified by:
getData
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setData
Sets the custom data associated with this session.- Parameters:
data
- The session data, may benull
.- Returns:
- This session for chaining, never
null
.
-
getCache
- Specified by:
getCache
in interfaceorg.eclipse.aether.RepositorySystemSession
-
setCache
Sets the cache the repository system may use to save data for future reuse during the session.- Parameters:
cache
- The repository cache, may benull
if none.- Returns:
- This session for chaining, never
null
.
-
addOnSessionEndedHandler
Registers onSessionEnded handler, if able to.- Specified by:
addOnSessionEndedHandler
in interfaceorg.eclipse.aether.RepositorySystemSession
- Parameters:
handler
- The handler to register- Returns:
- Return
true
if registration was possible, otherwisefalse
.
-
setReadOnly
Marks this session as read-only such that any future attempts to call its mutators will fail with an exception. Marking an already read-only session as read-only has no effect. The session's data and cache remain writable though.
-