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, ref

    Fields inherited from class org.apache.tools.ant.ProjectComponent

    description, location, project
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for RemoteRepositories data type.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Allow ant to add a single remote repository to the list of containers.
    void
    Allow Ant to add another RemoteRepositories instance to this container.
    Resolves this object if defined as a reference and verifies that it is a RemoteRepositories instance.
    Returns a flattened list of all RemoteRepository instances contained in this object.
    void
    setRefid(org.apache.tools.ant.types.Reference ref)
    Sets a reference to another RemoteRepositories instance.
    void
    validate(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, toString

    Methods inherited from class org.apache.tools.ant.ProjectComponent

    getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RemoteRepositories

      public RemoteRepositories()
      Default constructor for RemoteRepositories data type.

      Initializes an empty collection of remote repositories.

  • Method Details

    • getRef

      protected RemoteRepositories getRef()
      Resolves this object if defined as a reference and verifies that it is a RemoteRepositories instance.
      Returns:
      the referenced RemoteRepositories instance
      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 RemoteRepositoryContainer is validated individually.

      Specified by:
      validate in interface RemoteRepositoryContainer
      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 another RemoteRepositories instance.

      Once a reference is set, this instance must not contain any child elements.

      Overrides:
      setRefid in class org.apache.tools.ant.types.DataType
      Parameters:
      ref - the Ant reference pointing to another RemoteRepositories object
      Throws:
      org.apache.tools.ant.BuildException - if this object already contains children
    • addRemoterepo

      public void addRemoterepo(RemoteRepository repository)
      Allow ant to add a single remote repository to the list of containers.
      Parameters:
      repository - the RemoteRepository to add
      Throws:
      org.apache.tools.ant.BuildException - if this object is defined as a reference
    • addRemoterepos

      public void addRemoterepos(RemoteRepositories repositories)
      Allow Ant to add another RemoteRepositories instance to this container.

      This allows composition of multiple repository lists.

      Parameters:
      repositories - the RemoteRepositories to add
      Throws:
      org.apache.tools.ant.BuildException - if this object is defined as a reference
      org.apache.tools.ant.BuildException - if the specified object is the same as this instance (circular reference)
    • getRepositories

      public List<RemoteRepository> getRepositories()
      Returns a flattened list of all RemoteRepository instances contained in this object.

      If this is a reference, the call is delegated to the referenced object.

      Specified by:
      getRepositories in interface RemoteRepositoryContainer
      Returns:
      the list of remote repositories