|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
org.gradle.api.artifacts.ArtifactRepositoryContainer org.gradle.api.NamedDomainObjectCollection org.gradle.util.Configurable java.lang.Iterable org.gradle.api.NamedDomainObjectList org.gradle.api.DomainObjectCollection java.util.Collection org.gradle.api.artifacts.dsl.RepositoryHandler
public interface RepositoryHandler extends ArtifactRepositoryContainer
A RepositoryHandler manages a set of repositories, allowing repositories to be defined and queried.
Field Summary |
---|
Method Summary | |
---|---|
FlatDirectoryArtifactRepository
|
flatDir(Map 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 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 action)
Adds and configures an Ivy repository. |
MavenArtifactRepository
|
jcenter(Action 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 action)
Adds and configures a Maven repository. |
MavenArtifactRepository
|
mavenCentral(Map 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. |
DependencyResolver
|
mavenRepo(Map args)
Adds a repository which is Maven compatible. |
DependencyResolver
|
mavenRepo(Map args, Closure configClosure)
Adds a repository which is Maven compatible. |
Methods inherited from interface ArtifactRepositoryContainer | |
---|---|
add, add, add, addAfter, addAfter, addBefore, addBefore, addFirst, addFirst, addFirst, addLast, addLast, addLast, getAt, getByName, getByName, getResolvers |
Methods inherited from interface NamedDomainObjectList | |
---|---|
findAll, matching, matching, withType |
Methods inherited from interface NamedDomainObjectCollection | |
---|---|
add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getNames, getRules, matching, matching, withType |
Methods inherited from 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 args)
":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"] }
args
- The arguments used to configure the repository.
public FlatDirectoryArtifactRepository flatDir(Closure configureClosure)
configureClosure
- The closure to execute to configure the repository.
public FlatDirectoryArtifactRepository flatDir(Action action)
action
- The action to execute to configure the repository.
public IvyArtifactRepository ivy(Closure closure)
closure
- The closure to use to configure the repository.
public IvyArtifactRepository ivy(Action action)
action
- The action to use to configure the repository.
public MavenArtifactRepository jcenter(Action action)
The URL used to access this repository is {
Examples:
repositories { jcenter { artifactUrls = ["http://www.mycompany.com/artifacts1", "http://www.mycompany.com/artifacts2"] } jcenter { name = "nonDefaultName" artifactUrls = ["http://www.mycompany.com/artifacts1"] } }
action
- a configuration action
public MavenArtifactRepository jcenter()
The URL used to access this repository is {
Examples:
repositories { jcenter() }
public MavenArtifactRepository maven(Closure closure)
closure
- The closure to use to configure the repository.
public MavenArtifactRepository maven(Action action)
action
- The action to use to configure the repository.
public MavenArtifactRepository mavenCentral(Map args)
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"] }
args
- A list of urls of repositories to look for artifacts only.
public MavenArtifactRepository mavenCentral()
Examples:
repositories { mavenCentral() }
public MavenArtifactRepository mavenLocal()
Examples:
repositories { mavenLocal() }
@SuppressWarnings("JavadocReference") @Deprecated public DependencyResolver mavenRepo(Map args)
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. |
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. |
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.
args
- The argument to create the repository
@Deprecated public DependencyResolver mavenRepo(Map args, Closure configClosure)
args
- The argument to create the repositoryconfigClosure
- Further configuration of the dependency resolver
Gradle API 1.12