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:
  • Field Details

    • NAME

      public static final String NAME
      See Also:
    • CONFIG_PROP_ENABLED

      public static final 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:
      Sourced from:
      RepositorySystemSession.getConfigProperties()
      Value type:
      Boolean
      Default value:
      DEFAULT_ENABLED
      Supports Repo ID Suffix:
      Yes
    • DEFAULT_ENABLED

      public static final boolean DEFAULT_ENABLED
      See Also:
    • CONFIG_PROP_SKIPPED

      public static final 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:
      Sourced from:
      RepositorySystemSession.getConfigProperties()
      Value type:
      Boolean
      Default value:
      DEFAULT_SKIPPED
      Supports Repo ID Suffix:
      Yes
    • DEFAULT_SKIPPED

      public static final boolean DEFAULT_SKIPPED
      See Also:
    • CONFIG_PROP_NO_INPUT_OUTCOME

      public static final 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:
      Sourced from:
      RepositorySystemSession.getConfigProperties()
      Value type:
      Boolean
      Default value:
      DEFAULT_NO_INPUT_OUTCOME
      Supports Repo ID Suffix:
      Yes
    • DEFAULT_NO_INPUT_OUTCOME

      public static final boolean DEFAULT_NO_INPUT_OUTCOME
      See Also:
    • CONFIG_PROP_BASEDIR

      public static final String 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

      public static final String LOCAL_REPO_PREFIX_DIR
      See Also:
    • CONFIG_PROP_RECORD

      public static final String 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

  • Method Details

    • isEnabled

      protected boolean isEnabled(org.eclipse.aether.RepositorySystemSession session)
      Description copied from class: RemoteRepositoryFilterSourceSupport
      Returns true if session configuration contains this name set to true.

      Default is true.

      Specified by:
      isEnabled in class RemoteRepositoryFilterSourceSupport
    • 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, List<org.eclipse.aether.resolution.ArtifactResult> artifactResults)
      Specified by:
      postProcess in interface org.eclipse.aether.spi.resolution.ArtifactResolverPostProcessor