Class Dependency
java.lang.Object
org.apache.maven.api.plugin.descriptor.Dependency
- All Implemented Interfaces:
Serializable
@Experimental
@Generated
@ThreadSafe
@Immutable
public class Dependency
extends Object
implements Serializable
Definition of a dependency, needed by the plugin at runtime.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create Dependency instances. -
Constructor Summary
ModifierConstructorDescriptionprotected
Dependency
(Dependency.Builder builder) Constructor for this class, to be called from its subclasses andDependency.Builder
. -
Method Summary
Modifier and TypeMethodDescriptionThe artifact id of the dependency.The group id of the dependency.getType()
The type of dependency.The version of the dependency.static Dependency.Builder
Creates a newDependency
builder instance.static Dependency.Builder
newBuilder
(boolean withDefaults) Creates a newDependency
builder instance using default values or not.static Dependency.Builder
newBuilder
(Dependency from) Creates a newDependency
builder instance using the specified object as a basis.static Dependency.Builder
newBuilder
(Dependency from, boolean forceCopy) Creates a newDependency
builder instance using the specified object as a basis.static Dependency
Creates a newDependency
instance.static Dependency
newInstance
(boolean withDefaults) Creates a newDependency
instance using default values or not.with()
Creates a new builder with this object as the basis.withArtifactId
(String artifactId) Creates a newDependency
instance using the specified artifactId.withGroupId
(String groupId) Creates a newDependency
instance using the specified groupId.Creates a newDependency
instance using the specified type.withVersion
(String version) Creates a newDependency
instance using the specified version.
-
Constructor Details
-
Dependency
Constructor for this class, to be called from its subclasses andDependency.Builder
.- See Also:
-
-
Method Details
-
getGroupId
The group id of the dependency.- Returns:
- a
String
-
getArtifactId
The artifact id of the dependency.- Returns:
- a
String
-
getVersion
The version of the dependency.- Returns:
- a
String
-
getType
The type of dependency.- Returns:
- a
String
-
with
Creates a new builder with this object as the basis.- Returns:
- a
Builder
-
withGroupId
Creates a newDependency
instance using the specified groupId.- Parameters:
groupId
- the newString
to use- Returns:
- a
Dependency
with the specified groupId
-
withArtifactId
Creates a newDependency
instance using the specified artifactId.- Parameters:
artifactId
- the newString
to use- Returns:
- a
Dependency
with the specified artifactId
-
withVersion
Creates a newDependency
instance using the specified version.- Parameters:
version
- the newString
to use- Returns:
- a
Dependency
with the specified version
-
withType
Creates a newDependency
instance using the specified type.- Parameters:
type
- the newString
to use- Returns:
- a
Dependency
with the specified type
-
newInstance
Creates a newDependency
instance. Equivalent tonewInstance(true)
.- Returns:
- a new
Dependency
- See Also:
-
newInstance
Creates a newDependency
instance using default values or not. Equivalent tonewBuilder(withDefaults).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Dependency
-
newBuilder
Creates a newDependency
builder instance. Equivalent tonewBuilder(true)
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newDependency
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 newDependency
builder instance using the specified object as a basis. Equivalent tonewBuilder(from, false)
.- Parameters:
from
- theDependency
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newDependency
builder instance using the specified object as a basis.- Parameters:
from
- theDependency
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-