public class DefaultRepositoryHandler extends DefaultArtifactRepositoryContainer implements RepositoryHandler, ResolverProvider
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| Constructor and Description |
|---|
DefaultRepositoryHandler(ResolverFactory resolverFactory,
Instantiator instantiator) |
| 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 |
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)
Adds a repository which is Maven compatible.
|
org.apache.ivy.plugins.resolver.DependencyResolver |
mavenRepo(Map<String,?> args,
Closure configClosure)
Adds a repository which is Maven compatible.
|
add, add, addAfter, addAfter, addBefore, addBefore, addFirst, addFirst, addFirst, addLast, addLast, addLast, addRepository, addRepository, addRepository, addRepository, addRepository, addRepository, addRepository, configure, createNotFoundException, findName, getResolverFactory, getResolvers, getTypeDisplayName, toResolveradd, addAll, filteredStore, findAll, get, getStore, indexOf, lastIndexOf, listIterator, listIterator, matching, matching, remove, set, subList, withTypeadd, addRule, addRule, assertCanAdd, assertCanAdd, filtered, findByName, findByNameWithoutRules, getAsDynamicObject, getAsMap, getAt, getByName, getByName, getConvention, getDisplayName, getElementsAsDynamicObject, getExtensions, getInstantiator, getNamer, getRules, handleAttemptToAddItemWithNonUniqueName, hasWithName, removeByNameaddAll, all, all, assertMutable, beforeChange, clear, contains, containsAll, createFilter, createFilter, createFilter, filteredEvents, findAll, getEventRegister, getType, isEmpty, iterator, remove, removeAll, retainAll, size, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withTypetoArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, add, add, addAfter, addAfter, addBefore, addBefore, addFirst, addFirst, addFirst, addLast, addLast, addLast, getAt, getByName, getByName, getResolversfindAll, matching, matching, withTypeaddAll, addRule, addRule, findByName, getAsMap, getNamer, getRulesall, all, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withTypeclear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArrayadd, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArrayconfiguregetResolverspublic DefaultRepositoryHandler(ResolverFactory resolverFactory, Instantiator instantiator)
public FlatDirectoryArtifactRepository flatDir(Action<? super FlatDirectoryArtifactRepository> action)
RepositoryHandlerflatDir in interface RepositoryHandleraction - The action to execute to configure the repository.public FlatDirectoryArtifactRepository flatDir(Closure configureClosure)
RepositoryHandlerflatDir in interface RepositoryHandlerconfigureClosure - The closure to execute to configure the repository.public FlatDirectoryArtifactRepository flatDir(Map<String,?> args)
RepositoryHandler":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 for Project.files(Object...) |
Examples:
repositories {
flatDir name: 'libs', dirs: "$projectDir/libs"
flatDir dirs: ["$projectDir/libs1", "$projectDir/libs2"]
}
flatDir in interface RepositoryHandlerargs - The arguments used to configure the repository.public MavenArtifactRepository mavenCentral()
RepositoryHandlerExamples:
repositories {
mavenCentral()
}
mavenCentral in interface RepositoryHandlerRepositoryHandler.mavenCentral(java.util.Map)public MavenArtifactRepository mavenCentral(Map<String,?> args)
RepositoryHandlerArtifactRepositoryContainer.MAVEN_CENTRAL_URL. The behavior of this resolver
is otherwise the same as the ones added by RepositoryHandler.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 for 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"]
}
mavenCentral in interface RepositoryHandlerargs - A list of urls of repositories to look for artifacts only.public MavenArtifactRepository mavenLocal()
RepositoryHandlerExamples:
repositories {
mavenLocal()
}
mavenLocal in interface RepositoryHandlerpublic org.apache.ivy.plugins.resolver.DependencyResolver mavenRepo(Map<String,?> args)
RepositoryHandlerorg.gradle.api.plugins.MavenRepositoryHandlerConvention#mavenDeployer(java.util.Map) or
org.gradle.api.plugins.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 for 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 for 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.mavenRepo in interface RepositoryHandlerargs - The argument to create the repositorypublic org.apache.ivy.plugins.resolver.DependencyResolver mavenRepo(Map<String,?> args, Closure configClosure)
RepositoryHandlermavenRepo in interface RepositoryHandlerargs - The argument to create the repositoryconfigClosure - Further configuration of the dependency resolverRepositoryHandler.mavenRepo(java.util.Map)public MavenArtifactRepository maven(Action<? super MavenArtifactRepository> action)
RepositoryHandlermaven in interface RepositoryHandleraction - The action to use to configure the repository.public MavenArtifactRepository maven(Closure closure)
RepositoryHandlermaven in interface RepositoryHandlerclosure - The closure to use to configure the repository.public IvyArtifactRepository ivy(Action<? super IvyArtifactRepository> action)
RepositoryHandlerivy in interface RepositoryHandleraction - The action to use to configure the repository.public IvyArtifactRepository ivy(Closure closure)
RepositoryHandlerivy in interface RepositoryHandlerclosure - The closure to use to configure the repository.Copyright © 2013. All rights reserved