Class Repository

java.lang.Object
org.apache.maven.api.model.RepositoryBase
org.apache.maven.api.model.Repository
All Implemented Interfaces:
Serializable, InputLocationTracker
Direct Known Subclasses:
DeploymentRepository

A repository contains the information needed for establishing connections with remote repository.
See Also:
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class RepositoryBase
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class RepositoryBase
    • getReleases

      public RepositoryPolicy getReleases()
      How to handle downloading of releases from this repository.
      Returns:
      a RepositoryPolicy
    • getSnapshots

      public RepositoryPolicy getSnapshots()
      How to handle downloading of snapshots from this repository.
      Returns:
      a RepositoryPolicy
    • with

      Creates a new builder with this object as the basis.
      Overrides:
      with in class RepositoryBase
      Returns:
      a Builder
    • withId

      @Nonnull public Repository withId(String id)
      Creates a new Repository instance using the specified id.
      Overrides:
      withId in class RepositoryBase
      Parameters:
      id - the new String to use
      Returns:
      a Repository with the specified id
    • withName

      @Nonnull public Repository withName(String name)
      Creates a new Repository instance using the specified name.
      Overrides:
      withName in class RepositoryBase
      Parameters:
      name - the new String to use
      Returns:
      a Repository with the specified name
    • withUrl

      @Nonnull public Repository withUrl(String url)
      Creates a new Repository instance using the specified url.
      Overrides:
      withUrl in class RepositoryBase
      Parameters:
      url - the new String to use
      Returns:
      a Repository with the specified url
    • withLayout

      @Nonnull public Repository withLayout(String layout)
      Creates a new Repository instance using the specified layout.
      Overrides:
      withLayout in class RepositoryBase
      Parameters:
      layout - the new String to use
      Returns:
      a Repository with the specified layout
    • withReleases

      @Nonnull public Repository withReleases(RepositoryPolicy releases)
      Creates a new Repository instance using the specified releases.
      Parameters:
      releases - the new RepositoryPolicy to use
      Returns:
      a Repository with the specified releases
    • withSnapshots

      @Nonnull public Repository withSnapshots(RepositoryPolicy snapshots)
      Creates a new Repository instance using the specified snapshots.
      Parameters:
      snapshots - the new RepositoryPolicy to use
      Returns:
      a Repository with the specified snapshots
    • newInstance

      @Nonnull public static Repository newInstance()
      Creates a new Repository instance. Equivalent to newInstance( true ).
      Returns:
      a new Repository
      See Also:
    • newInstance

      @Nonnull public static Repository newInstance(boolean withDefaults)
      Creates a new Repository instance using default values or not. Equivalent to newBuilder( withDefaults ).build().
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Repository
    • newBuilder

      @Nonnull public static Repository.Builder newBuilder()
      Creates a new Repository builder instance. Equivalent to newBuilder( true ).
      Returns:
      a new Builder
      See Also:
    • newBuilder

      @Nonnull public static Repository.Builder newBuilder(boolean withDefaults)
      Creates a new Repository builder instance using default values or not.
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Repository.Builder newBuilder(Repository from)
      Creates a new Repository builder instance using the specified object as a basis. Equivalent to newBuilder( from, false ).
      Parameters:
      from - the Repository instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Repository.Builder newBuilder(Repository from, boolean forceCopy)
      Creates a new Repository builder instance using the specified object as a basis.
      Parameters:
      from - the Repository instance to use as a basis
      forceCopy - the boolean indicating if a copy should be forced
      Returns:
      a new Builder