Class RepositoryBase

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

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 Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      A unique identifier for a repository. This is used to match the repository to configuration in the settings.xml file, for example. Furthermore, the identifier is used during POM inheritance and profile injection to detect repositories that should be merged.
      Returns:
      a String
    • getName

      public String getName()
      Human readable name of the repository.
      Returns:
      a String
    • getUrl

      public String getUrl()
      The url of the repository, in the form protocol://hostname/path.
      Returns:
      a String
    • getLayout

      public String getLayout()
      The type of layout this repository uses for locating and storing artifacts - can be legacy or default.
      Returns:
      a String
    • getLocation

      public InputLocation getLocation(Object key)
      Gets the location of the specified field in the input source.
      Specified by:
      getLocation in interface InputLocationTracker
    • with

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

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

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

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

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

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

      @Nonnull public static RepositoryBase newInstance(boolean withDefaults)
      Creates a new RepositoryBase 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 RepositoryBase
    • newBuilder

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

      @Nonnull public static RepositoryBase.Builder newBuilder(boolean withDefaults)
      Creates a new RepositoryBase 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 RepositoryBase.Builder newBuilder(RepositoryBase from)
      Creates a new RepositoryBase builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the RepositoryBase instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

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