Class RepositoryIdHelper

java.lang.Object
org.eclipse.aether.util.repository.RepositoryIdHelper

public final class RepositoryIdHelper extends Object
Helper class for ArtifactRepository.getId() handling. This class provides helper methods to get id of repository as it was originally envisioned: as path safe, unique, etc. While POMs are validated by Maven, there are POMs out there that somehow define repositories with unsafe characters in their id. The problem affects mostly RemoteRepository instances, as all other implementations have fixed ids that are path safe.

Important: multiple of these provided methods are not trivial processing-wise, and some sort of caching is warmly recommended.

Since:
2.0.11
See Also:
  • Method Details

    • getRepositoryKeyFunction

      public static org.eclipse.aether.repository.RepositoryKeyFunction getRepositoryKeyFunction(String keyTypeString)
      Selector method for RepositoryKeyFunction based on string representation of RepositoryIdHelper.RepositoryKeyType enum.
    • simpleRepositoryKey

      public static String simpleRepositoryKey(org.eclipse.aether.repository.RemoteRepository repository, String context)
      Simple repositoryKey function (classic). Returns RemoteRepository.getId(), unless RemoteRepository.isRepositoryManager() returns true, in which case this method creates unique identifier based on ID and current configuration of the remote repository and context.

      This was the default repositoryKey method in Maven 3. Is exposed (others key methods are private) as it is directly used by "simple" LRM.

      Since:
      2.0.14