Class ContextualSnapshotVersionFilter
java.lang.Object
org.eclipse.aether.util.graph.version.ContextualSnapshotVersionFilter
- All Implemented Interfaces:
VersionFilter
A version filter that blocks "*-SNAPSHOT" versions if the
root artifact of the dependency graph is not a
snapshot. Alternatively, this filter can be forced to always ban snapshot versions by setting the boolean
configuration property CONFIG_PROP_ENABLE to
true.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.aether.collection.VersionFilter
VersionFilter.VersionFilterContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key in the repository session'sconfiguration propertiesused to store aBooleanflag whether this filter should be forced to ban snapshots.private final SnapshotVersionFilter -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of this version filter. -
Method Summary
Modifier and TypeMethodDescriptionDerives a version filter for the specified collection context.booleanvoidFilters the available versions for a given dependency.inthashCode()private booleanisEnabled(RepositorySystemSession session)
-
Field Details
-
CONFIG_PROP_ENABLE
The key in the repository session'sconfiguration propertiesused to store aBooleanflag whether this filter should be forced to ban snapshots. By default, snapshots are only filtered if the root artifact is not a snapshot.- See Also:
-
filter
-
-
Constructor Details
-
ContextualSnapshotVersionFilter
public ContextualSnapshotVersionFilter()Creates a new instance of this version filter.
-
-
Method Details
-
isEnabled
-
filterVersions
Description copied from interface:VersionFilterFilters the available versions for a given dependency. Implementations will usually callcontext.iterator()to inspect the available versions and useIterator.remove()to delete unacceptable versions. If no versions remain after all filtering has been performed, the dependency collection process will automatically fail, i.e. implementations need not handle this situation on their own.- Specified by:
filterVersionsin interfaceVersionFilter- Parameters:
context- The version filter context, must not benull.
-
deriveChildFilter
Description copied from interface:VersionFilterDerives a version filter for the specified collection context. The derived filter will be used to handle version ranges encountered in child dependencies of the current node. When calculating the child filter, implementors are strongly advised to simply return the current instance if nothing changed to help save memory.- Specified by:
deriveChildFilterin interfaceVersionFilter- Parameters:
context- The dependency collection context, must not benull.- Returns:
- The version filter for the target node or
nullif versions should not be filtered any more.
-
equals
-
hashCode
public int hashCode()
-