Package org.apache.maven.api.model
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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create RepositoryPolicy instances. -
Method Summary
Modifier and TypeMethodDescriptionWhat to do when verification of an artifact checksum fails.Whether to use this repository for downloading this type of artifact.getLocation
(Object key) Gets the location of the specified field in the input source.The frequency for downloading updates - can bealways,
daily
(default),interval:XXX
(in minutes) ornever
(only if it doesn't exist locally).boolean
static RepositoryPolicy.Builder
Creates a newRepositoryPolicy
builder instance.static RepositoryPolicy.Builder
newBuilder
(boolean withDefaults) Creates a newRepositoryPolicy
builder instance using default values or not.static RepositoryPolicy.Builder
newBuilder
(RepositoryPolicy from) Creates a newRepositoryPolicy
builder instance using the specified object as a basis.static RepositoryPolicy.Builder
newBuilder
(RepositoryPolicy from, boolean forceCopy) Creates a newRepositoryPolicy
builder instance using the specified object as a basis.static RepositoryPolicy
Creates a newRepositoryPolicy
instance.static RepositoryPolicy
newInstance
(boolean withDefaults) Creates a newRepositoryPolicy
instance using default values or not.with()
Creates a new builder with this object as the basis.withChecksumPolicy
(String checksumPolicy) Creates a newRepositoryPolicy
instance using the specified checksumPolicy.withEnabled
(String enabled) Creates a newRepositoryPolicy
instance using the specified enabled.withUpdatePolicy
(String updatePolicy) Creates a newRepositoryPolicy
instance using the specified updatePolicy.
-
Method Details
-
getEnabled
Whether to use this repository for downloading this type of artifact. Note: While the type of this field isString
for technical reasons, the semantic type is actuallyBoolean
. Default value istrue
.- Returns:
- a
String
-
getUpdatePolicy
The frequency for downloading updates - can bealways,
daily
(default),interval:XXX
(in minutes) ornever
(only if it doesn't exist locally).- Returns:
- a
String
-
getChecksumPolicy
What to do when verification of an artifact checksum fails. Valid values areignore
,fail
(default for Maven 4 and above) orwarn
(default for Maven 2 and 3)- Returns:
- a
String
-
getLocation
Gets the location of the specified field in the input source.- Specified by:
getLocation
in interfaceInputLocationTracker
-
with
Creates a new builder with this object as the basis.- Returns:
- a
Builder
-
withEnabled
Creates a newRepositoryPolicy
instance using the specified enabled.- Parameters:
enabled
- the newString
to use- Returns:
- a
RepositoryPolicy
with the specified enabled
-
withUpdatePolicy
Creates a newRepositoryPolicy
instance using the specified updatePolicy.- Parameters:
updatePolicy
- the newString
to use- Returns:
- a
RepositoryPolicy
with the specified updatePolicy
-
withChecksumPolicy
Creates a newRepositoryPolicy
instance using the specified checksumPolicy.- Parameters:
checksumPolicy
- the newString
to use- Returns:
- a
RepositoryPolicy
with the specified checksumPolicy
-
newInstance
Creates a newRepositoryPolicy
instance. Equivalent tonewInstance( true )
.- Returns:
- a new
RepositoryPolicy
- See Also:
-
newInstance
Creates a newRepositoryPolicy
instance using default values or not. Equivalent tonewBuilder( withDefaults ).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
RepositoryPolicy
-
newBuilder
Creates a newRepositoryPolicy
builder instance. Equivalent tonewBuilder( true )
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newRepositoryPolicy
builder instance using default values or not.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newRepositoryPolicy
builder instance using the specified object as a basis. Equivalent tonewBuilder( from, false )
.- Parameters:
from
- theRepositoryPolicy
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
@Nonnull public static RepositoryPolicy.Builder newBuilder(RepositoryPolicy from, boolean forceCopy) Creates a newRepositoryPolicy
builder instance using the specified object as a basis.- Parameters:
from
- theRepositoryPolicy
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
isEnabled
public boolean isEnabled()
-