Class JkRepoSet

java.lang.Object
dev.jeka.core.api.depmanagement.JkRepoSet

public final class JkRepoSet extends Object
A set of JkRepo
  • Method Details

    • of

      public static JkRepoSet of(Iterable<JkRepo> configs)
      Creates a repository set from the specified configurations.
    • of

      public static JkRepoSet of(JkRepo repo, JkRepo... others)
      Creates a repository set from the specified configurations.
    • of

      public static JkRepoSet of(String... urls)
      Crates a JkRepoSet from the specified JkRepos
    • and

      public JkRepoSet and(JkRepo other)
      Returns a repo identical to this one but with the extra specified repository.
    • and

      public JkRepoSet and(JkRepoSet other)
      Returns a merge of this repository and the specified one.
    • ofLocal

      public static JkRepoSet ofLocal()
    • ofOssrhSnapshotAndRelease

      public static JkRepoSet ofOssrhSnapshotAndRelease(String userName, String password, JkFileSigner signer)
      Creates a JkRepoSet for publishing on OSSRH
    • getRepoConfigHavingUrl

      public JkRepo getRepoConfigHavingUrl(String url)
      Return the individual repository from this set having the specified url. Returns null if no such repository found.
    • getRepos

      public List<JkRepo> getRepos()
      Returns the list of repositories configured in this repository set.
    • contains

      public boolean contains(URL url)
      Checks if the specified URL is present in the repository set.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toStringMultiline

      public String toStringMultiline(String margin)
    • toReadonly

      public JkRepoSet toReadonly()
      Returns an immutable copy of this repository set, ensuring that the underlying repositories are also marked as read-only.
    • get

      public Path get(JkCoordinate coordinate)
      Retrieves directly the file embodying the specified the external dependency.
    • get

      public Path get(String coordinate)
      Retrieves the file associated with the specified dependency coordinate. Delegates to get(JkCoordinate) by constructing a JkCoordinate from the given string representation.
      Parameters:
      coordinate - the string representation of the dependency coordinate to resolve
      Returns:
      the path to the resolved file, or null if the dependency cannot be resolved
    • withDefaultSigner

      public JkRepoSet withDefaultSigner(JkFileSigner signer)
    • findVersionsOf

      public List<String> findVersionsOf(String moduleId)
      Finds the available versions of a given module identifier from the configured repositories. Iterates through the repository set and returns the versions found in the first repository that contains the module versions. If no versions are found in any repository, it returns an empty list.
      Parameters:
      moduleId - the identifier of the module whose versions are to be retrieved
      Returns:
      a list of versions available for the specified module identifier, or an empty list if none are found