Class RemoteRepositories
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.maven.resolver.internal.ant.types.RemoteRepositories
- All Implemented Interfaces:
Cloneable,RemoteRepositoryContainer
public class RemoteRepositories
extends org.apache.tools.ant.types.DataType
implements RemoteRepositoryContainer
Represents a collection of remote repositories used for dependency resolution or artifact deployment.
This container allows combining multiple RemoteRepository and nested <remoterepositories> elements
into a single referenceable unit. It supports recursive composition and reference resolution through refid.
This type can be used in Ant build scripts to define reusable sets of repositories.
- See Also:
-
Field Summary
Fields inherited from class org.apache.tools.ant.types.DataType
checked, refFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRemoterepo(RemoteRepository repository) Allow ant to add a single remote repository to the list of containers.voidaddRemoterepos(RemoteRepositories repositories) Allow Ant to add anotherRemoteRepositoriesinstance to this container.protected RemoteRepositoriesgetRef()Resolves this object if defined as a reference and verifies that it is aRemoteRepositoriesinstance.Returns a flattened list of allRemoteRepositoryinstances contained in this object.voidsetRefid(org.apache.tools.ant.types.Reference ref) Sets a reference to anotherRemoteRepositoriesinstance.voidvalidate(org.apache.tools.ant.Task task) Validates the contained repositories.Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes, toStringMethods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
Constructor Details
-
RemoteRepositories
public RemoteRepositories()Default constructor forRemoteRepositoriesdata type.Initializes an empty collection of remote repositories.
-
-
Method Details
-
getRef
Resolves this object if defined as a reference and verifies that it is aRemoteRepositoriesinstance.- Returns:
- the referenced
RemoteRepositoriesinstance - Throws:
org.apache.tools.ant.BuildException- if the reference is invalid
-
validate
public void validate(org.apache.tools.ant.Task task) Validates the contained repositories.If this object is defined as a reference, validation is delegated to the referenced instance. Otherwise, each nested
RemoteRepositoryContaineris validated individually.- Specified by:
validatein interfaceRemoteRepositoryContainer- Parameters:
task- the Ant task requesting validation, used for error reporting
-
setRefid
public void setRefid(org.apache.tools.ant.types.Reference ref) Sets a reference to anotherRemoteRepositoriesinstance.Once a reference is set, this instance must not contain any child elements.
- Overrides:
setRefidin classorg.apache.tools.ant.types.DataType- Parameters:
ref- the Ant reference pointing to anotherRemoteRepositoriesobject- Throws:
org.apache.tools.ant.BuildException- if this object already contains children
-
addRemoterepo
Allow ant to add a single remote repository to the list of containers.- Parameters:
repository- theRemoteRepositoryto add- Throws:
org.apache.tools.ant.BuildException- if this object is defined as a reference
-
addRemoterepos
Allow Ant to add anotherRemoteRepositoriesinstance to this container.This allows composition of multiple repository lists.
- Parameters:
repositories- theRemoteRepositoriesto add- Throws:
org.apache.tools.ant.BuildException- if this object is defined as a referenceorg.apache.tools.ant.BuildException- if the specified object is the same as this instance (circular reference)
-
getRepositories
Returns a flattened list of allRemoteRepositoryinstances contained in this object.If this is a reference, the call is delegated to the referenced object.
- Specified by:
getRepositoriesin interfaceRemoteRepositoryContainer- Returns:
- the list of remote repositories
-