Package: org.gradle.api.artifacts.dsl

## [Java] Interface RepositoryHandler

- org.gradle.api.NamedDomainObjectCollection

- All Superinterfaces:
    ArtifactRepositoryContainer, NamedDomainObjectList, Configurable, Iterable, DomainObjectCollection, Collection, NamedDomainObjectCollection

  A `RepositoryHandler` manages a set of repositories, allowing repositories to be defined and queried.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `interface ArtifactRepositoryContainer` | `DEFAULT_MAVEN_CENTRAL_REPO_NAME, DEFAULT_MAVEN_LOCAL_REPO_NAME, MAVEN_CENTRAL_URL`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `FlatDirectoryArtifactRepository` | `flatDir(Map<String, ?> args)` Adds a resolver that looks into a number of directories for artifacts.
    `FlatDirectoryArtifactRepository` | `flatDir(Closure configureClosure)` Adds an configures a repository which will look for dependencies in a number of local directories.
    `FlatDirectoryArtifactRepository` | `flatDir(Action<? super FlatDirectoryArtifactRepository> action)` Adds an configures a repository which will look for dependencies in a number of local directories.
    `IvyArtifactRepository` | `ivy(Closure closure)` Adds and configures an Ivy repository.
    `IvyArtifactRepository` | `ivy(Action<? super IvyArtifactRepository> action)` Adds and configures an Ivy repository.
    `MavenArtifactRepository` | `jcenter(Action<? super MavenArtifactRepository> action)` Adds a repository which looks in Bintray's JCenter repository for dependencies.
    `MavenArtifactRepository` | `jcenter()` Adds a repository which looks in Bintray's JCenter repository for dependencies.
    `MavenArtifactRepository` | `maven(Closure closure)` Adds and configures a Maven repository.
    `MavenArtifactRepository` | `maven(Action<? super MavenArtifactRepository> action)` Adds and configures a Maven repository.
    `MavenArtifactRepository` | `mavenCentral(Map<String, ?> args)` Adds a repository which looks in the Maven central repository for dependencies.
    `MavenArtifactRepository` | `mavenCentral()` Adds a repository which looks in the Maven central repository for dependencies.
    `MavenArtifactRepository` | `mavenLocal()` Adds a repository which looks in the local Maven cache for dependencies.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface ArtifactRepositoryContainer` | `add, addFirst, addLast, getAt, getByName, getByName`
    `interface NamedDomainObjectList` | `findAll, matching, matching, withType`
    `interface NamedDomainObjectCollection` | `add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getNames, getRules, matching, matching, withType`
    `interface List` | `add, add, get, equals, hashCode, indexOf, clear, contains, isEmpty, lastIndexOf, size, subList, toArray, toArray, addAll, addAll, iterator, remove, remove, set, containsAll, listIterator, listIterator, removeAll, retainAll`

- - ### Method Detail

    - #### public FlatDirectoryArtifactRepository flatDir(Map<String, ?> args)

      Adds a resolver that looks into a number of directories for artifacts. The artifacts are expected to be located in the root of the specified directories. The resolver ignores any group/organization information specified in the dependency section of your build script. If you only use this kind of resolver you might specify your dependencies like `":junit:4.4"` instead of `"junit:junit:4.4"`. The following parameter are accepted as keys for the map:

      Key | Description of Associated Value
      --- | ---
      `name` | (optional) The name of the repository. The default is a Hash value of the rootdir paths. The name is used in the console output, to point to information related to a particular repository. A name must be unique amongst a repository group.
      `dirs` | Specifies a list of rootDirs where to look for dependencies. These are evaluated as per Project.files

      Examples:

           repositories {
               flatDir name: 'libs', dirs: "$projectDir/libs"
               flatDir dirs: ["$projectDir/libs1", "$projectDir/libs2"]
           }

      throws:
        org.gradle.api.InvalidUserDataException In the case neither rootDir nor rootDirs is specified of if both are specified.
      Parameters:
        `args` - The arguments used to configure the repository.
      Returns:
        the added resolver

    - #### public FlatDirectoryArtifactRepository flatDir(Closure configureClosure)

      Adds an configures a repository which will look for dependencies in a number of local directories.

      Parameters:
        `configureClosure` - The closure to execute to configure the repository.
      Returns:
        The repository.

    - #### public FlatDirectoryArtifactRepository flatDir(Action<? super FlatDirectoryArtifactRepository> action)

      Adds an configures a repository which will look for dependencies in a number of local directories.

      Parameters:
        `action` - The action to execute to configure the repository.
      Returns:
        The repository.

    - #### public IvyArtifactRepository ivy(Closure closure)

      Adds and configures an Ivy repository.

      Parameters:
        `closure` - The closure to use to configure the repository.
      Returns:
        The added repository.

    - #### public IvyArtifactRepository ivy(Action<? super IvyArtifactRepository> action)

      Adds and configures an Ivy repository.

      Parameters:
        `action` - The action to use to configure the repository.
      Returns:
        The added repository.

    - #### public MavenArtifactRepository jcenter(Action<? super MavenArtifactRepository> action)

      Adds a repository which looks in Bintray's JCenter repository for dependencies.

      The URL used to access this repository is "https://jcenter.bintray.com/". The behavior of this repository is otherwise the same as those added by maven(org.gradle.api.Action).

      Examples:

           repositories {
             jcenter {
               artifactUrls = ["http://www.mycompany.com/artifacts1", "http://www.mycompany.com/artifacts2"]
             }
             jcenter {
               name = "nonDefaultName"
               artifactUrls = ["http://www.mycompany.com/artifacts1"]
             }
           }

      Parameters:
        `action` - a configuration action
      Returns:
        the added repository

    - #### public MavenArtifactRepository jcenter()

      Adds a repository which looks in Bintray's JCenter repository for dependencies.

      The URL used to access this repository is "https://jcenter.bintray.com/". The behavior of this repository is otherwise the same as those added by maven(org.gradle.api.Action).

      Examples:

           repositories {
               jcenter()
           }

      Returns:
        the added resolver
      See Also:
        jcenter(Action)

    - #### public MavenArtifactRepository maven(Closure closure)

      Adds and configures a Maven repository.

      Parameters:
        `closure` - The closure to use to configure the repository.
      Returns:
        The added repository.

    - #### public MavenArtifactRepository maven(Action<? super MavenArtifactRepository> action)

      Adds and configures a Maven repository.

      Parameters:
        `action` - The action to use to configure the repository.
      Returns:
        The added repository.

    - #### public MavenArtifactRepository mavenCentral(Map<String, ?> args)

      Adds a repository which looks in the Maven central repository for dependencies. The URL used to access this repository is {

      value:
        org.gradle.api.artifacts.ArtifactRepositoryContainer#MAVEN_CENTRAL_URL}.

        The following parameter are accepted as keys for the map:

        Key | Description of Associated Value
        --- | ---
        `name` | (optional) The name of the repository. The default is {@value org.gradle.api.artifacts.ArtifactRepositoryContainer#DEFAULT_MAVEN_CENTRAL_REPO_NAME} is used as the name. A name must be unique amongst a repository group.
        `artifactUrls` | A single jar repository or a collection of jar repositories containing additional artifacts not found in the Maven central repository. But be aware that the POM must exist in Maven central. The provided values are evaluated as per Project.uri.

        Examples:

             repositories {
                 mavenCentral artifactUrls: ["http://www.mycompany.com/artifacts1", "http://www.mycompany.com/artifacts2"]
                 mavenCentral name: "nonDefaultName", artifactUrls: ["http://www.mycompany.com/artifacts1"]
             }

      Parameters:
        `args` - A list of urls of repositories to look for artifacts only.
      Returns:
        the added repository

    - #### public MavenArtifactRepository mavenCentral()

      Adds a repository which looks in the Maven central repository for dependencies. The URL used to access this repository is {

      value:
        org.gradle.api.artifacts.ArtifactRepositoryContainer#MAVEN_CENTRAL_URL}. The name of the repository is {@value org.gradle.api.artifacts.ArtifactRepositoryContainer#DEFAULT_MAVEN_CENTRAL_REPO_NAME}.

        Examples:

             repositories {
                 mavenCentral()
             }

      Returns:
        the added resolver
      See Also:
        mavenCentral(java.util.Map)

    - #### public MavenArtifactRepository mavenLocal()

      Adds a repository which looks in the local Maven cache for dependencies. The name of the repository is {

      value:
        org.gradle.api.artifacts.ArtifactRepositoryContainer#DEFAULT_MAVEN_LOCAL_REPO_NAME}.

        Examples:

             repositories {
                 mavenLocal()
             }

      Returns:
        the added resolver