public final class ContextualSnapshotVersionFilter extends Object implements VersionFilter
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
.VersionFilter.VersionFilterContext
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_PROP_ENABLE
The key in the repository session's
configuration
properties used to store a Boolean flag whether this filter should be forced to ban snapshots. |
Constructor and Description |
---|
ContextualSnapshotVersionFilter()
Creates a new instance of this version filter.
|
Modifier and Type | Method and Description |
---|---|
VersionFilter |
deriveChildFilter(DependencyCollectionContext context)
Derives a version filter for the specified collection context.
|
boolean |
equals(Object obj) |
void |
filterVersions(VersionFilter.VersionFilterContext context)
Filters the available versions for a given dependency.
|
int |
hashCode() |
public static final String CONFIG_PROP_ENABLE
configuration
properties
used to store a Boolean
flag whether this filter should be forced to ban snapshots. By
default, snapshots are only filtered if the root artifact is not a snapshot.public ContextualSnapshotVersionFilter()
public void filterVersions(VersionFilter.VersionFilterContext context)
VersionFilter
context.iterator()
to inspect the available versions and use
Iterator.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.filterVersions
in interface VersionFilter
context
- The version filter context, must not be null
.public VersionFilter deriveChildFilter(DependencyCollectionContext context)
VersionFilter
deriveChildFilter
in interface VersionFilter
context
- The dependency collection context, must not be null
.null
if versions should not be filtered any more.Copyright © 2010–2022 The Apache Software Foundation. All rights reserved.