org.gradle.api.artifacts.dsl

## Interface RepositoryHandler

- All Superinterfaces:
    ArtifactRepositoryContainer, Collection<ArtifactRepository>, org.gradle.util.Configurable<ArtifactRepositoryContainer>, DomainObjectCollection<ArtifactRepository>, Iterable<ArtifactRepository>, List<ArtifactRepository>, NamedDomainObjectCollection<ArtifactRepository>, NamedDomainObjectList<ArtifactRepository>

      public interface RepositoryHandler
      extends ArtifactRepositoryContainer

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

- - ### Field Summary

    - ### Fields inherited from interface org.gradle.api.artifacts.ArtifactRepositoryContainer

      `DEFAULT_CACHE_ARTIFACT_PATTERN, DEFAULT_CACHE_IVY_PATTERN, DEFAULT_MAVEN_CENTRAL_REPO_NAME, DEFAULT_MAVEN_LOCAL_REPO_NAME, INTERNAL_REPOSITORY_NAME, MAVEN_CENTRAL_URL, MAVEN_REPO_PATTERN, RESOLVER_NAME, RESOLVER_URL`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `FlatDirectoryArtifactRepository` | `flatDir(Action<? super FlatDirectoryArtifactRepository> action)` Adds an configures a repository which will look for dependencies in a number of local directories.
    `FlatDirectoryArtifactRepository` | `flatDir(Closure configureClosure)` Adds an configures a repository which will look for dependencies in a number of local directories.
    `FlatDirectoryArtifactRepository` | `flatDir(Map<String,?> args)` Adds a resolver that looks into a number of directories for artifacts.
    `IvyArtifactRepository` | `ivy(Action<? super IvyArtifactRepository> action)` Adds and configures an Ivy repository.
    `IvyArtifactRepository` | `ivy(Closure closure)` Adds and configures an Ivy repository.
    `MavenArtifactRepository` | `jcenter()` Adds a repository which looks in Bintray's JCenter repository for dependencies.
    `MavenArtifactRepository` | `jcenter(Action<? super MavenArtifactRepository> action)` Adds a repository which looks in Bintray's JCenter repository for dependencies.
    `MavenArtifactRepository` | `maven(Action<? super MavenArtifactRepository> action)` Adds and configures a Maven repository.
    `MavenArtifactRepository` | `maven(Closure closure)` Adds and configures a Maven repository.
    `MavenArtifactRepository` | `mavenCentral()` Adds a repository which looks in the Maven central repository for dependencies.
    `MavenArtifactRepository` | `mavenCentral(Map<String,?> args)` 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.
    `org.apache.ivy.plugins.resolver.DependencyResolver` | `mavenRepo(Map<String,?> args)` Deprecated. Use `maven(groovy.lang.Closure)` instead.
    `org.apache.ivy.plugins.resolver.DependencyResolver` | `mavenRepo(Map<String,?> args, Closure configClosure)` Deprecated. Use `maven(groovy.lang.Closure)` instead.

    - ### Methods inherited from interface org.gradle.api.artifacts.ArtifactRepositoryContainer

      `add, add, add, addAfter, addAfter, addBefore, addBefore, addFirst, addFirst, addFirst, addLast, addLast, addLast, getAt, getByName, getByName, getResolvers`

    - ### Methods inherited from interface org.gradle.api.NamedDomainObjectList

      `findAll, matching, matching, withType`

    - ### Methods inherited from interface org.gradle.api.NamedDomainObjectCollection

      `addAll, addRule, addRule, findByName, getAsMap, getNamer, getNames, getRules`

    - ### Methods inherited from interface org.gradle.api.DomainObjectCollection

      `all, all, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withType`

    - ### Methods inherited from interface java.util.Collection

      `clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray`

    - ### Methods inherited from interface java.util.List

      `add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray`

    - ### Methods inherited from interface org.gradle.util.Configurable

      `configure`

- - ### Method Detail

    - #### flatDir

          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(Object...)`

      Examples:

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

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

    - #### flatDir

          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.

    - #### flatDir

          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.

    - #### jcenter

          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 "http://jcenter.bintray.com/". The behavior of this resolver is otherwise the same as the ones 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

    - #### jcenter

          MavenArtifactRepository jcenter()

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

      The URL used to access this repository is "http://jcenter.bintray.com/". The behavior of this resolver is otherwise the same as the ones added by `mavenCentral()`.

      Examples:

           repositories {
               jcenter()
           }

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

    - #### mavenCentral

          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 "http://repo1.maven.org/maven2/". The behavior of this resolver is otherwise the same as the ones added by `mavenRepo(java.util.Map)`. 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 "MavenRepo" 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(Object)`.

      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

    - #### mavenCentral

          MavenArtifactRepository mavenCentral()

      Adds a repository which looks in the Maven central repository for dependencies. The URL used to access this repository is "http://repo1.maven.org/maven2/". The name of the repository is "MavenRepo".

      Examples:

           repositories {
               mavenCentral()
           }

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

    - #### mavenLocal

          MavenArtifactRepository mavenLocal()

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

      Examples:

           repositories {
               mavenLocal()
           }

      Returns:
        the added resolver

    - #### mavenRepo

          @Deprecated
          org.apache.ivy.plugins.resolver.DependencyResolver mavenRepo(Map<String,?> args)

      Deprecated. Use `maven(groovy.lang.Closure)` instead.
      Adds a repository which is Maven compatible. The compatibility is in regard to layout, snapshot handling and dealing with the pom.xml. This repository can't be used for publishing in a Maven compatible way. For publishing to a Maven repository, have a look at `MavenRepositoryHandlerConvention.mavenDeployer(java.util.Map)` or `MavenRepositoryHandlerConvention.mavenInstaller(java.util.Map)`. By default the repository accepts to resolve artifacts without a POM. The repository always looks first for the POM in the root repository. It then looks for the artifact in the root repository. Sometimes the artifact lives in a different repository than the POM. In such a case you can specify further locations to look for an artifact. But be aware that the POM is only looked up in the root repository. 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 the URL of the root repo. 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.
      `url` | The root repository where POM files and artifacts are located. The provided values are evaluated as per `Project.uri(Object)`.
      `artifactUrls` | A single jar repository or a collection of jar repositories containing additional artifacts not found in the root repository. Sometimes the artifact lives in a different repository than the POM. In such a case you can specify further locations to look for an artifact. But be aware that the POM is only looked up in the root repository. The provided values are evaluated as per `Project.uri(Object)`.

      Examples:

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

      For Ivy related reasons, Maven Snapshot dependencies are only properly resolved if no additional jar locations are specified. This is unfortunate and we hope to improve this in a future release.
      Parameters:
        `args` - The argument to create the repository
      Returns:
        the added repository

    - #### mavenRepo

          @Deprecated
          org.apache.ivy.plugins.resolver.DependencyResolver mavenRepo(Map<String,?> args,
                                                                                Closure configClosure)

      Deprecated. Use `maven(groovy.lang.Closure)` instead.
      Adds a repository which is Maven compatible.
      Parameters:
        `args` - The argument to create the repository
        `configClosure` - Further configuration of the dependency resolver
      Returns:
        The created dependency resolver
      See Also:
        `mavenRepo(java.util.Map)`

    - #### maven

          MavenArtifactRepository maven(Closure closure)

      Adds and configures a Maven repository.
      Parameters:
        `closure` - The closure to use to configure the repository.
      Returns:
        The added repository.

    - #### maven

          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.

    - #### ivy

          IvyArtifactRepository ivy(Closure closure)

      Adds and configures an Ivy repository.
      Parameters:
        `closure` - The closure to use to configure the repository.
      Returns:
        The added repository.

    - #### ivy

          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.