Table of Contents
| API Documentation: | RepositoryHandler |
|---|
A RepositoryHandler manages a set of repositories, allowing repositories to be defined and queried.
| Method | Description |
flatDir(configureClosure) | Adds and configures a repository which will look for dependencies in a number of local directories. |
flatDir(args) | Deprecated 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 |
flatDir(action) | Adds and configures a repository which will look for dependencies in a number of local directories. |
google() | Adds a repository which looks in Google's Maven repository for dependencies. |
google(action) | Adds a repository which looks in Google's Maven repository for dependencies. |
gradlePluginPortal() | Adds a repository which looks in Gradle Central Plugin Repository for dependencies. |
gradlePluginPortal(action) | Adds a repository which looks in Gradle Central Plugin Repository for dependencies. |
ivy(closure) | Adds and configures an Ivy repository. Newly created instance of |
ivy(action) | Adds and configures an Ivy repository. |
maven(closure) | Adds and configures a Maven repository. Newly created instance of |
maven(action) | Adds and configures a Maven repository. |
mavenCentral() | Adds a repository which looks in the Maven central repository for dependencies. The URL used to access this repository is
|
mavenCentral(args) | Deprecated Adds a repository which looks in the Maven central repository for dependencies. The URL used to access this repository is
|
mavenCentral(action) | Adds a repository which looks in the Maven central repository for dependencies. The URL used to access this repository is
|
mavenLocal() | Adds a repository which looks in the local Maven cache for dependencies. The name of the repository is
|
mavenLocal(action) | Adds a repository which looks in the local Maven cache for dependencies. The name of the repository is
|
FlatDirectoryArtifactRepository flatDir(Closure configureClosure)
Adds and configures a repository which will look for dependencies in a number of local directories.
FlatDirectoryArtifactRepository flatDir(Map<String, ?> args)
Map<String, ?>Note: This method is deprecated and will be removed in the next major version of Gradle.
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(java.lang.Object[]) |
FlatDirectoryArtifactRepository flatDir(Action<? super FlatDirectoryArtifactRepository> action)
Action<? super FlatDirectoryArtifactRepository>Adds and configures a repository which will look for dependencies in a number of local directories.
MavenArtifactRepository google()
Adds a repository which looks in Google's Maven repository for dependencies.
The URL used to access this repository is "https://dl.google.com/dl/android/maven2/".
Examples:
repositories {
google()
}
MavenArtifactRepository google(Action<? super MavenArtifactRepository> action)
Action<? super MavenArtifactRepository>Adds a repository which looks in Google's Maven repository for dependencies.
The URL used to access this repository is "https://dl.google.com/dl/android/maven2/".
Examples:
repositories {
google()
}
ArtifactRepository gradlePluginPortal()
Adds a repository which looks in Gradle Central Plugin Repository for dependencies.
The return type of this method may be safely cast to UrlArtifactRepository.
ArtifactRepository gradlePluginPortal(Action<? super ArtifactRepository> action)
Action<? super ArtifactRepository>Adds a repository which looks in Gradle Central Plugin Repository for dependencies.
The return type of this method may be safely cast to UrlArtifactRepository.
IvyArtifactRepository ivy(Closure closure)
Adds and configures an Ivy repository. Newly created instance of IvyArtifactRepository is passed as an argument to the closure.
IvyArtifactRepository ivy(Action<? super IvyArtifactRepository> action)
Action<? super IvyArtifactRepository>Adds and configures an Ivy repository.
MavenArtifactRepository maven(Closure closure)
Adds and configures a Maven repository. Newly created instance of MavenArtifactRepository is passed as an argument to the closure.
MavenArtifactRepository maven(Action<? super MavenArtifactRepository> action)
Action<? super MavenArtifactRepository>Adds and configures a Maven repository.
MavenArtifactRepository mavenCentral()
Adds a repository which looks in the Maven central repository for dependencies. The URL used to access this repository is
https://repo.maven.apache.org/maven2/. The name of the repository is
MavenRepo.
Examples:
repositories {
mavenCentral()
}
MavenArtifactRepository mavenCentral(Map<String, ?> args)
Map<String, ?>Note: This method is deprecated and will be removed in the next major version of Gradle.
Adds a repository which looks in the Maven central repository for dependencies. The URL used to access this repository is
https://repo.maven.apache.org/maven2/.
The following parameter is accepted as a key 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.
|
MavenArtifactRepository mavenCentral(Action<? super MavenArtifactRepository> action)
Action<? super MavenArtifactRepository>Adds a repository which looks in the Maven central repository for dependencies. The URL used to access this repository is
https://repo.maven.apache.org/maven2/. The name of the repository is
MavenRepo.
Examples:
repositories {
mavenCentral()
}
MavenArtifactRepository mavenLocal()
Adds a repository which looks in the local Maven cache for dependencies. The name of the repository is
MavenLocal.
Examples:
repositories {
mavenLocal()
}
The location for the repository is determined as follows (in order of precedence):
- The value of system property 'maven.repo.local' if set;
- The value of element <localRepository> of
~/.m2/settings.xmlif this file exists and element is set; - The value of element <localRepository> of
$M2_HOME/conf/settings.xml(where$M2_HOMEis the value of the environment variable with that name) if this file exists and element is set; - The path
~/.m2/repository.
MavenArtifactRepository mavenLocal(Action<? super MavenArtifactRepository> action)
Action<? super MavenArtifactRepository>Adds a repository which looks in the local Maven cache for dependencies. The name of the repository is
MavenLocal.
Examples:
repositories {
mavenLocal()
}
The location for the repository is determined as follows (in order of precedence):
- The value of system property 'maven.repo.local' if set;
- The value of element <localRepository> of
~/.m2/settings.xmlif this file exists and element is set; - The value of element <localRepository> of
$M2_HOME/conf/settings.xml(where$M2_HOMEis the value of the environment variable with that name) if this file exists and element is set; - The path
~/.m2/repository.