Class GroupIdRemoteRepositoryFilterSource
- All Implemented Interfaces:
RemoteRepositoryFilterSource,ArtifactResolverPostProcessor
GroupTree.
The file can be authored manually. The file can also be pre-populated by "record" functionality of this filter.
When "recording", this filter will not filter out anything, but will instead populate the file with all encountered
groupIds recorded as =groupId. The recorded file should be authored afterward to fine tune it, as there is
no optimization in place (ie to look for smallest common parent groupId and alike).
The groupId file is expected on path "${basedir}/groupId-${repository.id}.txt".
The groupId file once loaded are cached in component, so in-flight groupId file change during component existence are NOT noticed.
- Since:
- 1.9.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe basedir where to store filter files.static final StringConfiguration to enable the GroupId filter (enabled by default).static final StringDetermines what happens when the filter is enabled, but has no groupId file available for given remote repository to work with.static final StringShould filter go into "record" mode (and collect encountered artifacts)?static final StringConfiguration to skip the GroupId filter for given request.static final booleanstatic final booleanstatic final booleanstatic final Stringstatic final StringFields inherited from class org.eclipse.aether.internal.impl.filter.RemoteRepositoryFilterSourceSupport
CONFIG_PROP_REPOSITORY_KEY_FUNCTION, CONFIG_PROPS_PREFIX, DEFAULT_REPOSITORY_KEY_FUNCTION -
Constructor Summary
ConstructorsConstructorDescriptionGroupIdRemoteRepositoryFilterSource(RepositoryKeyFunctionFactory repositoryKeyFunctionFactory, RepositorySystemLifecycle repositorySystemLifecycle, PathProcessor pathProcessor) -
Method Summary
Modifier and TypeMethodDescriptionProvides the filter instance for given session, ornullif this instance wants to abstain from participating in filtering.protected booleanisEnabled(RepositorySystemSession session) Returnstrueif session configuration contains this name set totrue.voidpostProcess(RepositorySystemSession session, List<ArtifactResult> artifactResults) Receives resolver results just before it would return it to caller.Methods inherited from class org.eclipse.aether.internal.impl.filter.RemoteRepositoryFilterSourceSupport
getBasedir, normalizeRemoteRepository, repositoryKey
-
Field Details
-
NAME
- See Also:
-
CONFIG_PROP_ENABLED
Configuration to enable the GroupId filter (enabled by default). Can be fine-tuned per repository using repository ID suffixes. Important: For this filter to take effect, you must provide configuration files. Without configuration files, the enabled filter remains dormant and does not interfere with resolution. Configuration Files:- Location: Directory specified by
CONFIG_PROP_BASEDIR(defaults to$LOCAL_REPO/.remoteRepositoryFilters) - Naming:
groupId-$(repository.id).txt - Content: One groupId per line to allow/block from the repository
.mvn/maven.config:-Daether.remoteRepositoryFilter.groupId=true -Daether.remoteRepositoryFilter.groupId.basedir=${session.rootDirectory}/.mvn/rrf/Then creategroupId-myrepoId.txtfiles in the.mvn/rrf/directory and commit them to version control.- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
Boolean- Default value:
DEFAULT_ENABLED- Supports Repo ID Suffix:
- Yes
- Location: Directory specified by
-
DEFAULT_ENABLED
- See Also:
-
CONFIG_PROP_SKIPPED
Configuration to skip the GroupId filter for given request. This configuration is evaluated and iftruethe GroupId remote filter will not kick in.- Since:
- 2.0.14
- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
Boolean- Default value:
DEFAULT_SKIPPED- Supports Repo ID Suffix:
- Yes
-
DEFAULT_SKIPPED
- See Also:
-
CONFIG_PROP_NO_INPUT_OUTCOME
Determines what happens when the filter is enabled, but has no groupId file available for given remote repository to work with. When set totrue(default), the filter allows all requests to proceed for given remote repository when no groupId file is available. When set tofalse, the filter blocks all requests toward given remote repository when no groupId file is available. This setting allows repoId suffix, hence, can determine "global" or "repository targeted" behaviors.- Since:
- 2.0.14
- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
Boolean- Default value:
DEFAULT_NO_INPUT_OUTCOME- Supports Repo ID Suffix:
- Yes
-
DEFAULT_NO_INPUT_OUTCOME
- See Also:
-
CONFIG_PROP_BASEDIR
The basedir where to store filter files. If path is relative, it is resolved from local repository root.- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
String- Default value:
LOCAL_REPO_PREFIX_DIR
-
LOCAL_REPO_PREFIX_DIR
- See Also:
-
CONFIG_PROP_RECORD
Should filter go into "record" mode (and collect encountered artifacts)?- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
Boolean- Default value:
- false
-
-
Constructor Details
-
GroupIdRemoteRepositoryFilterSource
@Inject public GroupIdRemoteRepositoryFilterSource(RepositoryKeyFunctionFactory repositoryKeyFunctionFactory, RepositorySystemLifecycle repositorySystemLifecycle, PathProcessor pathProcessor)
-
-
Method Details
-
isEnabled
Description copied from class:RemoteRepositoryFilterSourceSupportReturnstrueif session configuration contains this name set totrue.Default is
true.- Specified by:
isEnabledin classRemoteRepositoryFilterSourceSupport
-
getRemoteRepositoryFilter
Description copied from interface:RemoteRepositoryFilterSourceProvides the filter instance for given session, ornullif this instance wants to abstain from participating in filtering.- Specified by:
getRemoteRepositoryFilterin interfaceRemoteRepositoryFilterSource- Returns:
- The filter for given session or
null.
-
postProcess
Description copied from interface:ArtifactResolverPostProcessorReceives resolver results just before it would return it to caller. Is able to generate "resolution failure" by augmenting passed inArtifactResults (artifacts should be "unresolved" and exceptions added).Implementations must be aware that the passed in list of
ArtifactResults may have failed resolutions, best to check that usingArtifactResult.isResolved()method.The implementations must be aware that this call may be "hot", so it directly affects the performance of resolver in general.
- Specified by:
postProcessin interfaceArtifactResolverPostProcessor
-