Groovy Documentation

org.gradle.api.artifacts
[Java] Interface ArtifactRepositoryContainer

java.lang.Iterable
  org.gradle.api.DomainObjectCollection
      org.gradle.api.NamedDomainObjectList
          org.gradle.api.NamedDomainObjectCollection
              org.gradle.api.artifacts.ArtifactRepositoryContainer
                  java.util.Collection
All Superinterfaces:
java.lang.Iterable, DomainObjectCollection, NamedDomainObjectList, NamedDomainObjectCollection, java.util.Collection

public interface ArtifactRepositoryContainer
extends org.gradle.util.Configurable, NamedDomainObjectList

A ResolverContainer is responsible for managing a set of ArtifactRepository instances. Repositories are arranged in a sequence.

You can obtain a ResolverContainer instance by calling Project.getRepositories or using the repositories property in your build script.

The resolvers in a container are accessible as read-only properties of the container, using the name of the resolver as the property name. For example:

 resolvers.addLast(name: 'myResolver')
 resolvers.myResolver.url = 'some-url'
 

A dynamic method is added for each resolver which takes a configuration closure. This is equivalent to calling getByName(String, groovy.lang.Closure). For example:

 resolvers.addLast(name: 'myResolver')
 resolvers.myResolver {
     url 'some-url'
 }
 
Authors:
Hans Dockter


Field Summary
java.lang.String DEFAULT_CACHE_ARTIFACT_PATTERN

java.lang.String DEFAULT_CACHE_IVY_PATTERN

java.lang.String DEFAULT_MAVEN_CENTRAL_REPO_NAME

java.lang.String DEFAULT_MAVEN_LOCAL_REPO_NAME

java.lang.String INTERNAL_REPOSITORY_NAME

java.lang.String MAVEN_CENTRAL_URL

java.lang.String MAVEN_REPO_PATTERN

java.lang.String RESOLVER_NAME

java.lang.String RESOLVER_URL

 
Method Summary
boolean add(ArtifactRepository repository)

Adds a repository to this container, at the end of the repository sequence.

boolean add(org.apache.ivy.plugins.resolver.DependencyResolver resolver)

Adds a repository to this container, at the end of the repository sequence.

boolean add(org.apache.ivy.plugins.resolver.DependencyResolver resolver, groovy.lang.Closure configureClosure)

Adds a repository to this container, at the end of the repository sequence.

org.apache.ivy.plugins.resolver.DependencyResolver addAfter(java.lang.Object userDescription, java.lang.String previousResolver)

Adds a resolver to this container, after the given resolver.

org.apache.ivy.plugins.resolver.DependencyResolver addAfter(java.lang.Object userDescription, java.lang.String previousResolver, groovy.lang.Closure configureClosure)

Adds a resolver to this container, after the given resolver.

org.apache.ivy.plugins.resolver.DependencyResolver addBefore(java.lang.Object userDescription, java.lang.String nextResolver)

Adds a resolver to this container, before the given resolver.

org.apache.ivy.plugins.resolver.DependencyResolver addBefore(java.lang.Object userDescription, java.lang.String nextResolver, groovy.lang.Closure configureClosure)

Adds a resolver to this container, before the given resolver.

void addFirst(ArtifactRepository repository)

Adds a repository to this container, at the start of the repository sequence.

org.apache.ivy.plugins.resolver.DependencyResolver addFirst(java.lang.Object userDescription)

Adds a resolver to this container, at the start of the resolver sequence.

org.apache.ivy.plugins.resolver.DependencyResolver addFirst(java.lang.Object userDescription, groovy.lang.Closure configureClosure)

Adds a resolver to this container, at the start of the resolver sequence.

void addLast(ArtifactRepository repository)

Adds a repository to this container, at the end of the repository sequence.

org.apache.ivy.plugins.resolver.DependencyResolver addLast(java.lang.Object userDescription)

Adds a repository to this container, at the end of the repository sequence.

org.apache.ivy.plugins.resolver.DependencyResolver addLast(java.lang.Object userDescription, groovy.lang.Closure configureClosure)

Adds a resolver to this container, at the end of the resolver sequence.

ArtifactRepository getAt(java.lang.String name)

{@inheritDoc}

ArtifactRepository getByName(java.lang.String name)

{@inheritDoc}

ArtifactRepository getByName(java.lang.String name, groovy.lang.Closure configureClosure)

{@inheritDoc}

java.util.List getResolvers()

Returns the resolvers in this container, in sequence.

 
Methods inherited from interface org.gradle.util.Configurable
org.gradle.util.Configurable#configure(groovy.lang.Closure)
 
Methods inherited from interface NamedDomainObjectList
findAll, matching, matching, withType
 
Methods inherited from interface NamedDomainObjectCollection
add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getRules, matching, matching, withType
 
Methods inherited from interface DomainObjectCollection
all, all, allObjects, allObjects, findAll, findAll, getAll, matching, matching, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withType, withType
 

Field Detail

DEFAULT_CACHE_ARTIFACT_PATTERN

public java.lang.String DEFAULT_CACHE_ARTIFACT_PATTERN


DEFAULT_CACHE_IVY_PATTERN

public java.lang.String DEFAULT_CACHE_IVY_PATTERN


DEFAULT_MAVEN_CENTRAL_REPO_NAME

public java.lang.String DEFAULT_MAVEN_CENTRAL_REPO_NAME


DEFAULT_MAVEN_LOCAL_REPO_NAME

public java.lang.String DEFAULT_MAVEN_LOCAL_REPO_NAME


INTERNAL_REPOSITORY_NAME

public java.lang.String INTERNAL_REPOSITORY_NAME


MAVEN_CENTRAL_URL

public java.lang.String MAVEN_CENTRAL_URL


MAVEN_REPO_PATTERN

public java.lang.String MAVEN_REPO_PATTERN


RESOLVER_NAME

public java.lang.String RESOLVER_NAME


RESOLVER_URL

public java.lang.String RESOLVER_URL


 
Method Detail

add

public boolean add(ArtifactRepository repository)
Adds a repository to this container, at the end of the repository sequence.
Parameters:
repository - The repository to add.


add

public boolean add(org.apache.ivy.plugins.resolver.DependencyResolver resolver)
Adds a repository to this container, at the end of the repository sequence.
Parameters:
resolver - The repository to add, represented as an Ivy org.apache.ivy.plugins.resolver.DependencyResolver.


add

public boolean add(org.apache.ivy.plugins.resolver.DependencyResolver resolver, groovy.lang.Closure configureClosure)
Adds a repository to this container, at the end of the repository sequence.
Parameters:
resolver - The repository to add, represented as an Ivy org.apache.ivy.plugins.resolver.DependencyResolver.
configureClosure - The closure to use to configure the repository.


addAfter

public org.apache.ivy.plugins.resolver.DependencyResolver addAfter(java.lang.Object userDescription, java.lang.String previousResolver)
Adds a resolver to this container, after the given resolver.
throws:
InvalidUserDataException when a resolver with the given name already exists in this container.
throws:
UnknownRepositoryException when the given previous resolver does not exist in this container.
Parameters:
userDescription - The resolver definition. See addLast(Object) for details of this parameter.
previousResolver - The existing resolver to add the new resolver after.
Returns:
The added resolver.


addAfter

public org.apache.ivy.plugins.resolver.DependencyResolver addAfter(java.lang.Object userDescription, java.lang.String previousResolver, groovy.lang.Closure configureClosure)
Adds a resolver to this container, after the given resolver. The resolver is configured using the given configure closure.
throws:
InvalidUserDataException when a resolver with the given name already exists in this container.
throws:
UnknownRepositoryException when the given previous resolver does not exist in this container.
Parameters:
userDescription - The resolver definition. See addLast(Object) for details of this parameter.
previousResolver - The existing resolver to add the new resolver after.
configureClosure - The closure to use to configure the resolver.
Returns:
The added resolver.


addBefore

public org.apache.ivy.plugins.resolver.DependencyResolver addBefore(java.lang.Object userDescription, java.lang.String nextResolver)
Adds a resolver to this container, before the given resolver.
throws:
InvalidUserDataException when a resolver with the given name already exists in this container.
throws:
UnknownRepositoryException when the given next resolver does not exist in this container.
Parameters:
userDescription - The resolver definition. See addLast(Object) for details of this parameter.
nextResolver - The existing resolver to add the new resolver before.
Returns:
The added resolver.


addBefore

public org.apache.ivy.plugins.resolver.DependencyResolver addBefore(java.lang.Object userDescription, java.lang.String nextResolver, groovy.lang.Closure configureClosure)
Adds a resolver to this container, before the given resolver. The resolver is configured using the given configure closure.
throws:
InvalidUserDataException when a resolver with the given name already exists in this container.
throws:
UnknownRepositoryException when the given next resolver does not exist in this container.
Parameters:
userDescription - The resolver definition. See addLast(Object) for details of this parameter.
nextResolver - The existing resolver to add the new resolver before.
configureClosure - The closure to use to configure the resolver.
Returns:
The added resolver.


addFirst

public void addFirst(ArtifactRepository repository)
Adds a repository to this container, at the start of the repository sequence.
Parameters:
repository - The repository to add.


addFirst

public org.apache.ivy.plugins.resolver.DependencyResolver addFirst(java.lang.Object userDescription)
Adds a resolver to this container, at the start of the resolver sequence.
throws:
InvalidUserDataException when a resolver with the given name already exists in this container.
Parameters:
userDescription - The resolver definition. See addLast(Object) for details of this parameter.
Returns:
The added resolver.


addFirst

public org.apache.ivy.plugins.resolver.DependencyResolver addFirst(java.lang.Object userDescription, groovy.lang.Closure configureClosure)
Adds a resolver to this container, at the start of the resolver sequence. The resolver is configured using the given configure closure.
throws:
InvalidUserDataException when a resolver with the given name already exists in this container.
Parameters:
userDescription - The resolver definition. See addLast(Object) for details of this parameter.
configureClosure - The closure to use to configure the resolver.
Returns:
The added resolver.


addLast

public void addLast(ArtifactRepository repository)
Adds a repository to this container, at the end of the repository sequence.
Parameters:
repository - The repository to add.


addLast

@Deprecated
public org.apache.ivy.plugins.resolver.DependencyResolver addLast(java.lang.Object userDescription)
Adds a repository to this container, at the end of the repository sequence. The given userDescription can be one of:
throws:
InvalidUserDataException when a resolver with the given name already exists in this container.
deprecated:
Use RepositoryHandler.maven or add(ArtifactRepository) instead.
Parameters:
userDescription - The resolver definition.
Returns:
The added resolver.


addLast

@Deprecated
public org.apache.ivy.plugins.resolver.DependencyResolver addLast(java.lang.Object userDescription, groovy.lang.Closure configureClosure)
Adds a resolver to this container, at the end of the resolver sequence. The resolver is configured using the given configure closure.
throws:
InvalidUserDataException when a resolver with the given name already exists in this container.
deprecated:
Use RepositoryHandler.maven or add(ArtifactRepository) instead.
Parameters:
userDescription - The resolver definition. See addLast(Object) for details of this parameter.
configureClosure - The closure to use to configure the resolver.
Returns:
The added resolver.


getAt

public ArtifactRepository getAt(java.lang.String name)
{@inheritDoc}


getByName

public ArtifactRepository getByName(java.lang.String name)
{@inheritDoc}


getByName

public ArtifactRepository getByName(java.lang.String name, groovy.lang.Closure configureClosure)
{@inheritDoc}


getResolvers

public java.util.List getResolvers()
Returns the resolvers in this container, in sequence.
Returns:
The resolvers in sequence. Returns an empty list if this container is empty.


 

Groovy Documentation