Class PrefixesRemoteRepositoryFilterSource

java.lang.Object
org.eclipse.aether.internal.impl.filter.RemoteRepositoryFilterSourceSupport
org.eclipse.aether.internal.impl.filter.PrefixesRemoteRepositoryFilterSource
All Implemented Interfaces:
org.eclipse.aether.spi.connector.filter.RemoteRepositoryFilterSource

@Singleton @Named("prefixes") public final class PrefixesRemoteRepositoryFilterSource extends RemoteRepositoryFilterSourceSupport
Remote repository filter source filtering on path prefixes. It is backed by a file that lists all allowed path prefixes from remote repository. Artifact that layout converted path (using remote repository layout) results in path with no corresponding prefix present in this file is filtered out.

The file can be authored manually: format is one prefix per line, comments starting with "#" (hash) and empty lines for structuring are supported, The "/" (slash) character is used as file separator. Some remote repositories and MRMs publish these kind of files, they can be downloaded from corresponding URLs.

The prefix file is expected on path "${basedir}/prefixes-${repository.id}.txt".

The prefixes file is once loaded and cached, so in-flight prefixes file change during component existence are not noticed.

Examples of published prefix files:

Since:
1.9.0
  • Field Details

    • NAME

      public static final String NAME
      See Also:
    • CONFIG_PROP_ENABLED

      public static final String CONFIG_PROP_ENABLED
      Configuration to enable the Prefixes filter (enabled by default). Can be fine-tuned per repository using repository ID suffixes. Important: For this filter to take effect, configuration files must be available. Without configuration files, the enabled filter remains dormant and does not interfere with resolution. Configuration File Resolution:
      1. User-provided files: Checked first from directory specified by CONFIG_PROP_BASEDIR (defaults to $LOCAL_REPO/.remoteRepositoryFilters)
      2. Auto-discovery: If not found, attempts to download from remote repository and cache locally
      File Naming: prefixes-$(repository.id).txt Recommended Setup (Auto-Discovery with Override Capability): Start with auto-discovery, but prepare for project-specific overrides. Add to .mvn/maven.config:
      -Daether.remoteRepositoryFilter.prefixes=true
      -Daether.remoteRepositoryFilter.prefixes.basedir=${session.rootDirectory}/.mvn/rrf/
      
      Initial setup: Don't provide any files - rely on auto-discovery as repositories are accessed. Override when needed: Create prefixes-myrepoId.txt files in .mvn/rrf/ and commit to version control. Caching: Auto-discovered prefix files are cached in the local repository with unique IDs (using RepositoryIdHelper.remoteRepositoryUniqueId(RemoteRepository)) to prevent conflicts that could cause build failures.
      See Also:
    • DEFAULT_ENABLED

      public static final boolean DEFAULT_ENABLED
      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:
    • LOCAL_REPO_PREFIX_DIR

      public static final String LOCAL_REPO_PREFIX_DIR
      See Also:
  • Constructor Details

  • Method Details