Package org.apache.maven.api.settings
Class RepositoryPolicy
java.lang.Object
org.apache.maven.api.settings.RepositoryPolicy
- All Implemented Interfaces:
- Serializable,- InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class RepositoryPolicy
extends Object
implements Serializable, InputLocationTracker
Download policy
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create RepositoryPolicy instances.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedRepositoryPolicy(RepositoryPolicy.Builder builder) Constructor for this class, to be called from its subclasses andRepositoryPolicy.Builder.
- 
Method SummaryModifier and TypeMethodDescriptionWhat to do when verification of an artifact checksum fails.Gets the input location that caused this model to be read.getLocation(Object key) Gets the location of the specified field in the input source.Gets the keys of the locations of the input source.The frequency for downloading updates - can be "always", "daily" (default), "interval:XXX" (in minutes) or "never" (only if it doesn't exist locally).booleanWhether to use this repository for downloading this type of artifact.static RepositoryPolicy.BuilderCreates a newRepositoryPolicybuilder instance.static RepositoryPolicy.BuildernewBuilder(boolean withDefaults) Creates a newRepositoryPolicybuilder instance using default values or not.static RepositoryPolicy.BuildernewBuilder(RepositoryPolicy from) Creates a newRepositoryPolicybuilder instance using the specified object as a basis.static RepositoryPolicy.BuildernewBuilder(RepositoryPolicy from, boolean forceCopy) Creates a newRepositoryPolicybuilder instance using the specified object as a basis.static RepositoryPolicyCreates a newRepositoryPolicyinstance.static RepositoryPolicynewInstance(boolean withDefaults) Creates a newRepositoryPolicyinstance using default values or not.with()Creates a new builder with this object as the basis.withChecksumPolicy(String checksumPolicy) Creates a newRepositoryPolicyinstance using the specified checksumPolicy.withEnabled(boolean enabled) Creates a newRepositoryPolicyinstance using the specified enabled.withUpdatePolicy(String updatePolicy) Creates a newRepositoryPolicyinstance using the specified updatePolicy.
- 
Constructor Details- 
RepositoryPolicyConstructor for this class, to be called from its subclasses andRepositoryPolicy.Builder.- See Also:
 
 
- 
- 
Method Details- 
isEnabledpublic boolean isEnabled()Whether to use this repository for downloading this type of artifact.- Returns:
- a boolean
 
- 
getUpdatePolicyThe 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
 
- 
getChecksumPolicyWhat 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
 
- 
getLocationGets the location of the specified field in the input source.- Specified by:
- getLocationin interface- InputLocationTracker
 
- 
getLocationKeysGets the keys of the locations of the input source.
- 
getImportedFromGets the input location that caused this model to be read.
- 
withCreates a new builder with this object as the basis.- Returns:
- a Builder
 
- 
withEnabledCreates a newRepositoryPolicyinstance using the specified enabled.- Parameters:
- enabled- the new- booleanto use
- Returns:
- a RepositoryPolicywith the specified enabled
 
- 
withUpdatePolicyCreates a newRepositoryPolicyinstance using the specified updatePolicy.- Parameters:
- updatePolicy- the new- Stringto use
- Returns:
- a RepositoryPolicywith the specified updatePolicy
 
- 
withChecksumPolicyCreates a newRepositoryPolicyinstance using the specified checksumPolicy.- Parameters:
- checksumPolicy- the new- Stringto use
- Returns:
- a RepositoryPolicywith the specified checksumPolicy
 
- 
newInstanceCreates a newRepositoryPolicyinstance. Equivalent tonewInstance(true).- Returns:
- a new RepositoryPolicy
- See Also:
 
- 
newInstanceCreates a newRepositoryPolicyinstance using default values or not. Equivalent tonewBuilder(withDefaults).build().- Parameters:
- withDefaults- the boolean indicating whether default values should be used
- Returns:
- a new RepositoryPolicy
 
- 
newBuilderCreates a newRepositoryPolicybuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new Builder
- See Also:
 
- 
newBuilderCreates a newRepositoryPolicybuilder instance using default values or not.- Parameters:
- withDefaults- the boolean indicating whether default values should be used
- Returns:
- a new Builder
 
- 
newBuilderCreates a newRepositoryPolicybuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
- from- the- RepositoryPolicyinstance to use as a basis
- Returns:
- a new Builder
 
- 
newBuilder@Nonnull public static RepositoryPolicy.Builder newBuilder(RepositoryPolicy from, boolean forceCopy) Creates a newRepositoryPolicybuilder instance using the specified object as a basis.- Parameters:
- from- the- RepositoryPolicyinstance to use as a basis
- forceCopy- the boolean indicating if a copy should be forced
- Returns:
- a new Builder
 
 
-