Class RepositoryIdHelper


  • public final class RepositoryIdHelper
    extends java.lang.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:
    PathUtils
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.eclipse.aether.repository.RepositoryKeyFunction getRepositoryKeyFunction​(java.lang.String keyTypeString)
      Selector method for RepositoryKeyFunction based on string representation of RepositoryIdHelper.RepositoryKeyType enum.
      static java.lang.String simpleRepositoryKey​(org.eclipse.aether.repository.RemoteRepository repository, java.lang.String context)
      Simple repositoryKey function (classic).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • simpleRepositoryKey

        public static java.lang.String simpleRepositoryKey​(org.eclipse.aether.repository.RemoteRepository repository,
                                                           java.lang.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