Package org.apache.maven.api.model
Class Parent
java.lang.Object
org.apache.maven.api.model.Parent
- All Implemented Interfaces:
Serializable
,InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class Parent
extends Object
implements Serializable, InputLocationTracker
The
<parent>
element contains information required to locate the parent project from which
this project will inherit from.
Note: The children of this element are not interpolated and must be given as literal values.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create Parent instances. -
Constructor Summary
ModifierConstructorDescriptionprotected
Parent
(Parent.Builder builder) Constructor for this class, to be called from its subclasses andParent.Builder
. -
Method Summary
Modifier and TypeMethodDescriptionThe artifact id of the parent project to inherit from.The group id of the parent project to inherit from.getId()
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 relative path of the parent subproject POM file or directory within the checkout.The version of the parent project to inherit.static Parent.Builder
Creates a newParent
builder instance.static Parent.Builder
newBuilder
(boolean withDefaults) Creates a newParent
builder instance using default values or not.static Parent.Builder
newBuilder
(Parent from) Creates a newParent
builder instance using the specified object as a basis.static Parent.Builder
newBuilder
(Parent from, boolean forceCopy) Creates a newParent
builder instance using the specified object as a basis.static Parent
Creates a newParent
instance.static Parent
newInstance
(boolean withDefaults) Creates a newParent
instance using default values or not.toString()
with()
Creates a new builder with this object as the basis.withArtifactId
(String artifactId) Creates a newParent
instance using the specified artifactId.withGroupId
(String groupId) Creates a newParent
instance using the specified groupId.withRelativePath
(String relativePath) Creates a newParent
instance using the specified relativePath.withVersion
(String version) Creates a newParent
instance using the specified version.
-
Constructor Details
-
Parent
Constructor for this class, to be called from its subclasses andParent.Builder
.- See Also:
-
-
Method Details
-
getGroupId
The group id of the parent project to inherit from.- Returns:
- a
String
-
getArtifactId
The artifact id of the parent project to inherit from.- Returns:
- a
String
-
getVersion
The version of the parent project to inherit.- Returns:
- a
String
-
getRelativePath
The relative path of the parent subproject POM file or directory within the checkout. If not specified, it defaults to..
, i.e. the parent directory. Maven looks for the parent POM first in this location on the filesystem if explicitly provided, then in the reactor if groupId and artifactId are provided, then in the default parent directory, then the local repository, and lastly in the remote repo. However, if the both relative path and the group ID / artifact ID are provided, they must match the file in the location given. Specify either therelativePath
or thegroupId
/artifactId
, not both.- Returns:
- a
String
-
getLocation
Gets the location of the specified field in the input source.- Specified by:
getLocation
in interfaceInputLocationTracker
-
getLocationKeys
Gets the keys of the locations of the input source. -
getLocationKeyStream
-
getImportedFrom
Gets the input location that caused this model to be read.- Specified by:
getImportedFrom
in interfaceInputLocationTracker
- Returns:
- InputLocation
-
with
Creates a new builder with this object as the basis.- Returns:
- a
Builder
-
withGroupId
Creates a newParent
instance using the specified groupId.- Parameters:
groupId
- the newString
to use- Returns:
- a
Parent
with the specified groupId
-
withArtifactId
Creates a newParent
instance using the specified artifactId.- Parameters:
artifactId
- the newString
to use- Returns:
- a
Parent
with the specified artifactId
-
withVersion
Creates a newParent
instance using the specified version.- Parameters:
version
- the newString
to use- Returns:
- a
Parent
with the specified version
-
withRelativePath
Creates a newParent
instance using the specified relativePath.- Parameters:
relativePath
- the newString
to use- Returns:
- a
Parent
with the specified relativePath
-
newInstance
Creates a newParent
instance. Equivalent tonewInstance(true)
.- Returns:
- a new
Parent
- See Also:
-
newInstance
Creates a newParent
instance using default values or not. Equivalent tonewBuilder(withDefaults).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Parent
-
newBuilder
Creates a newParent
builder instance. Equivalent tonewBuilder(true)
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newParent
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 newParent
builder instance using the specified object as a basis. Equivalent tonewBuilder(from, false)
.- Parameters:
from
- theParent
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newParent
builder instance using the specified object as a basis.- Parameters:
from
- theParent
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
getId
- Returns:
- the id as
groupId:artifactId:version
-
toString
-