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.ArtifactResolverPostProcessorRemote repository filter source filtering on G coordinate. It is backed by a file that is parsed intoGroupTree.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:
GroupTree
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONFIG_PROP_BASEDIRThe basedir where to store filter files.static java.lang.StringCONFIG_PROP_ENABLEDConfiguration to enable the GroupId filter (enabled by default).static java.lang.StringCONFIG_PROP_NO_INPUT_OUTCOMEDetermines what happens when the filter is enabled, but has no groupId file available for given remote repository to work with.static java.lang.StringCONFIG_PROP_RECORDShould filter go into "record" mode (and collect encountered artifacts)?static java.lang.StringCONFIG_PROP_SKIPPEDConfiguration to skip the GroupId filter for given request.static booleanDEFAULT_ENABLEDstatic booleanDEFAULT_NO_INPUT_OUTCOMEstatic booleanDEFAULT_SKIPPEDstatic java.lang.StringLOCAL_REPO_PREFIX_DIRstatic java.lang.StringNAME-
Fields inherited from class org.eclipse.aether.internal.impl.filter.RemoteRepositoryFilterSourceSupport
CONFIG_PROP_REPOSITORY_KEY_FUNCTION, CONFIG_PROPS_PREFIX, DEFAULT_REPOSITORY_KEY_FUNCTION
-
-
Constructor Summary
Constructors Constructor Description GroupIdRemoteRepositoryFilterSource(org.eclipse.aether.spi.remoterepo.RepositoryKeyFunctionFactory repositoryKeyFunctionFactory, RepositorySystemLifecycle repositorySystemLifecycle, org.eclipse.aether.spi.io.PathProcessor pathProcessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.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, java.util.List<org.eclipse.aether.resolution.ArtifactResult> artifactResults)-
Methods inherited from class org.eclipse.aether.internal.impl.filter.RemoteRepositoryFilterSourceSupport
getBasedir, normalizeRemoteRepository, repositoryKey
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
CONFIG_PROP_ENABLED
public static final java.lang.String 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:
- Constant Field Values
- Location: Directory specified by
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED
- See Also:
- Constant Field Values
-
CONFIG_PROP_SKIPPED
public static final java.lang.String 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:
- Constant Field Values
-
DEFAULT_SKIPPED
public static final boolean DEFAULT_SKIPPED
- See Also:
- Constant Field Values
-
CONFIG_PROP_NO_INPUT_OUTCOME
public static final java.lang.String 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:
- Constant Field Values
-
DEFAULT_NO_INPUT_OUTCOME
public static final boolean DEFAULT_NO_INPUT_OUTCOME
- See Also:
- Constant Field Values
-
CONFIG_PROP_BASEDIR
public static final java.lang.String CONFIG_PROP_BASEDIR
The basedir where to store filter files. If path is relative, it is resolved from local repository root.- See Also:
- Constant Field Values
-
LOCAL_REPO_PREFIX_DIR
public static final java.lang.String LOCAL_REPO_PREFIX_DIR
- See Also:
- Constant Field Values
-
CONFIG_PROP_RECORD
public static final java.lang.String CONFIG_PROP_RECORD
Should filter go into "record" mode (and collect encountered artifacts)?- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GroupIdRemoteRepositoryFilterSource
@Inject public GroupIdRemoteRepositoryFilterSource(org.eclipse.aether.spi.remoterepo.RepositoryKeyFunctionFactory repositoryKeyFunctionFactory, RepositorySystemLifecycle repositorySystemLifecycle, org.eclipse.aether.spi.io.PathProcessor pathProcessor)
-
-
Method Detail
-
isEnabled
protected boolean isEnabled(org.eclipse.aether.RepositorySystemSession session)
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, java.util.List<org.eclipse.aether.resolution.ArtifactResult> artifactResults)
- Specified by:
postProcessin interfaceorg.eclipse.aether.spi.resolution.ArtifactResolverPostProcessor
-
-