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
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create Parent instances. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedParent(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 parentpom.xmlfile within the checkout.The version of the parent project to inherit.static Parent.BuilderCreates a newParentbuilder instance.static Parent.BuildernewBuilder(boolean withDefaults) Creates a newParentbuilder instance using default values or not.static Parent.BuildernewBuilder(Parent from) Creates a newParentbuilder instance using the specified object as a basis.static Parent.BuildernewBuilder(Parent from, boolean forceCopy) Creates a newParentbuilder instance using the specified object as a basis.static ParentCreates a newParentinstance.static ParentnewInstance(boolean withDefaults) Creates a newParentinstance using default values or not.toString()with()Creates a new builder with this object as the basis.withArtifactId(String artifactId) Creates a newParentinstance using the specified artifactId.withGroupId(String groupId) Creates a newParentinstance using the specified groupId.withRelativePath(String relativePath) Creates a newParentinstance using the specified relativePath.withVersion(String version) Creates a newParentinstance 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 parentpom.xmlfile within the checkout. 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.relativePathallows 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:
getLocationin interfaceInputLocationTracker
-
getLocationKeys
Gets the keys of the locations of the input source. -
getImportedFrom
Gets the input location that caused this model to be read.- Specified by:
getImportedFromin interfaceInputLocationTracker- Returns:
- InputLocation
-
with
Creates a new builder with this object as the basis.- Returns:
- a
Builder
-
withGroupId
Creates a newParentinstance using the specified groupId.- Parameters:
groupId- the newStringto use- Returns:
- a
Parentwith the specified groupId
-
withArtifactId
Creates a newParentinstance using the specified artifactId.- Parameters:
artifactId- the newStringto use- Returns:
- a
Parentwith the specified artifactId
-
withVersion
Creates a newParentinstance using the specified version.- Parameters:
version- the newStringto use- Returns:
- a
Parentwith the specified version
-
withRelativePath
Creates a newParentinstance using the specified relativePath.- Parameters:
relativePath- the newStringto use- Returns:
- a
Parentwith the specified relativePath
-
newInstance
Creates a newParentinstance. Equivalent tonewInstance(true).- Returns:
- a new
Parent - See Also:
-
newInstance
Creates a newParentinstance 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 newParentbuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new
Builder - See Also:
-
newBuilder
Creates a newParentbuilder instance using default values or not.- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newParentbuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
from- theParentinstance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newParentbuilder instance using the specified object as a basis.- Parameters:
from- theParentinstance 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
-