Class RepositoryPolicy

java.lang.Object
org.apache.maven.api.settings.RepositoryPolicy
All Implemented Interfaces:
Serializable

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

    • isEnabled

      public boolean isEnabled()
      Whether to use this repository for downloading this type of artifact.
      Returns:
      a boolean
    • 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 "fail" (default for Maven 4 and above), "warn" (default for Maven 2 and 3) or "ignore".
      Returns:
      a String
    • with

      @Nonnull public RepositoryPolicy.Builder with()
      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withEnabled

      @Nonnull public RepositoryPolicy withEnabled(boolean enabled)
      Creates a new RepositoryPolicy instance using the specified enabled.
      Parameters:
      enabled - the new boolean 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