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. -
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()
getLocation
(Object key) Gets the location of the specified field in the input source.The relative path of the parentpom.xml
file within the check out.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.
-
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 parentpom.xml
file within the check out. If not specified, it defaults to../pom.xml
. Maven looks for the parent POM first in this location on the filesystem, then the local repository, and lastly in the remote repo.relativePath
allows you to select a different location, for example when your structure is flat, or deeper without an intermediate parent POM. However, the group ID, artifact ID and version are still required, and must match the file in the location given or it will revert to the repository for the POM. This feature is only for enhancing the development in a local checkout of that project. Set the value to an empty string in case you want to disable the feature and always resolve the parent POM from the repositories.- 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
-
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
-