Class GroupIdRemoteRepositoryFilterSource
java.lang.Object
org.eclipse.aether.internal.impl.filter.RemoteRepositoryFilterSourceSupport
org.eclipse.aether.internal.impl.filter.GroupIdRemoteRepositoryFilterSource
- All Implemented Interfaces:
org.eclipse.aether.spi.connector.filter.RemoteRepositoryFilterSource, org.eclipse.aether.spi.resolution.ArtifactResolverPostProcessor
@Singleton
@Named("groupId")
public final class GroupIdRemoteRepositoryFilterSource
extends RemoteRepositoryFilterSourceSupport
implements org.eclipse.aether.spi.resolution.ArtifactResolverPostProcessor
Remote repository filter source filtering on G coordinate. It is backed by a file that is parsed into
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class RemoteRepositoryFilterSourceSupport
RemoteRepositoryFilterSourceSupport.SimpleResult -
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 StringShould filter go into "record" mode (and collect encountered artifacts)?static final booleanstatic final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionGroupIdRemoteRepositoryFilterSource(RepositorySystemLifecycle repositorySystemLifecycle, org.eclipse.aether.spi.io.PathProcessor pathProcessor) -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.aether.spi.connector.filter.RemoteRepositoryFiltergetRemoteRepositoryFilter(org.eclipse.aether.RepositorySystemSession session) protected booleanisEnabled(org.eclipse.aether.RepositorySystemSession session) Returnstrueif session configuration contains this name set totrue.voidpostProcess(org.eclipse.aether.RepositorySystemSession session, List<org.eclipse.aether.resolution.ArtifactResult> artifactResults) Methods inherited from class RemoteRepositoryFilterSourceSupport
getBasedir
-
Field Details
-
NAME
-
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:
- Location: Directory specified by
-
DEFAULT_ENABLED
- 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:
-
LOCAL_REPO_PREFIX_DIR
- See Also:
-
CONFIG_PROP_RECORD
Should filter go into "record" mode (and collect encountered artifacts)?- See Also:
-
-
Constructor Details
-
GroupIdRemoteRepositoryFilterSource
@Inject public GroupIdRemoteRepositoryFilterSource(RepositorySystemLifecycle repositorySystemLifecycle, org.eclipse.aether.spi.io.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
public org.eclipse.aether.spi.connector.filter.RemoteRepositoryFilter getRemoteRepositoryFilter(org.eclipse.aether.RepositorySystemSession session) - Specified by:
getRemoteRepositoryFilterin interfaceorg.eclipse.aether.spi.connector.filter.RemoteRepositoryFilterSource
-
postProcess
public void postProcess(org.eclipse.aether.RepositorySystemSession session, List<org.eclipse.aether.resolution.ArtifactResult> artifactResults) - Specified by:
postProcessin interfaceorg.eclipse.aether.spi.resolution.ArtifactResolverPostProcessor
-