Class 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:
    GroupTree
    • Field Detail

      • 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
        Recommended Setup (Per-Project): Use project-specific configuration to avoid repository ID clashes. Add to .mvn/maven.config:
         -Daether.remoteRepositoryFilter.groupId=true
         -Daether.remoteRepositoryFilter.groupId.basedir=${session.rootDirectory}/.mvn/rrf/
         
        Then create groupId-myrepoId.txt files in the .mvn/rrf/ directory and commit them to version control.
        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 if true the GroupId remote filter will not kick in.
        Since:
        2.0.14
        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 to true (default), the filter allows all requests to proceed for given remote repository when no groupId file is available. When set to false, 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
      • 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
    • Constructor Detail

    • Method Detail

      • getRemoteRepositoryFilter

        public org.eclipse.aether.spi.connector.filter.RemoteRepositoryFilter getRemoteRepositoryFilter​(org.eclipse.aether.RepositorySystemSession session)
        Specified by:
        getRemoteRepositoryFilter in interface org.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:
        postProcess in interface org.eclipse.aether.spi.resolution.ArtifactResolverPostProcessor