Class RepositoryPolicy

java.lang.Object
org.apache.maven.api.model.RepositoryPolicy
All Implemented Interfaces:
Serializable, InputLocationTracker

@Experimental @Generated @ThreadSafe @Immutable public class RepositoryPolicy extends Object implements Serializable, InputLocationTracker
Download policy.
See Also:
  • Method Details

    • getEnabled

      public String getEnabled()
      Whether to use this repository for downloading this type of artifact. Note: While the type of this field is String for technical reasons, the semantic type is actually Boolean. Default value is true.
      Returns:
      a String
    • getUpdatePolicy

      public String getUpdatePolicy()
      The frequency for downloading updates - can be always, daily (default), interval:XXX (in minutes) or never (only if it doesn't exist locally).
      Returns:
      a String
    • getChecksumPolicy

      public String getChecksumPolicy()
      What to do when verification of an artifact checksum fails. Valid values are ignore, fail (default for Maven 4 and above) or warn (default for Maven 2 and 3)
      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
    • withEnabled

      @Nonnull public RepositoryPolicy withEnabled(String enabled)
      Creates a new RepositoryPolicy instance using the specified enabled.
      Parameters:
      enabled - the new String to use
      Returns:
      a RepositoryPolicy with the specified enabled
    • withUpdatePolicy

      @Nonnull public RepositoryPolicy withUpdatePolicy(String updatePolicy)
      Creates a new RepositoryPolicy instance using the specified updatePolicy.
      Parameters:
      updatePolicy - the new String to use
      Returns:
      a RepositoryPolicy with the specified updatePolicy
    • withChecksumPolicy

      @Nonnull public RepositoryPolicy withChecksumPolicy(String checksumPolicy)
      Creates a new RepositoryPolicy instance using the specified checksumPolicy.
      Parameters:
      checksumPolicy - the new String to use
      Returns:
      a RepositoryPolicy with the specified checksumPolicy
    • newInstance

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

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

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

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

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

      public boolean isEnabled()