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 SummaryNested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create Parent instances.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedParent(Parent.Builder builder) Constructor for this class, to be called from its subclasses andParent.Builder.
- 
Method SummaryModifier 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- 
ParentConstructor for this class, to be called from its subclasses andParent.Builder.- See Also:
 
 
- 
- 
Method Details- 
getGroupIdThe group id of the parent project to inherit from.- Returns:
- a String
 
- 
getArtifactIdThe artifact id of the parent project to inherit from.- Returns:
- a String
 
- 
getVersionThe version of the parent project to inherit.- Returns:
- a String
 
- 
getRelativePathThe 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
 
- 
getLocationGets the location of the specified field in the input source.- Specified by:
- getLocationin interface- InputLocationTracker
 
- 
getLocationKeysGets the keys of the locations of the input source.
- 
getImportedFromGets the input location that caused this model to be read.- Specified by:
- getImportedFromin interface- InputLocationTracker
- Returns:
- InputLocation
 
- 
withCreates a new builder with this object as the basis.- Returns:
- a Builder
 
- 
withGroupIdCreates a newParentinstance using the specified groupId.- Parameters:
- groupId- the new- Stringto use
- Returns:
- a Parentwith the specified groupId
 
- 
withArtifactIdCreates a newParentinstance using the specified artifactId.- Parameters:
- artifactId- the new- Stringto use
- Returns:
- a Parentwith the specified artifactId
 
- 
withVersionCreates a newParentinstance using the specified version.- Parameters:
- version- the new- Stringto use
- Returns:
- a Parentwith the specified version
 
- 
withRelativePathCreates a newParentinstance using the specified relativePath.- Parameters:
- relativePath- the new- Stringto use
- Returns:
- a Parentwith the specified relativePath
 
- 
newInstanceCreates a newParentinstance. Equivalent tonewInstance(true).- Returns:
- a new Parent
- See Also:
 
- 
newInstanceCreates 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
 
- 
newBuilderCreates a newParentbuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new Builder
- See Also:
 
- 
newBuilderCreates a newParentbuilder instance using default values or not.- Parameters:
- withDefaults- the boolean indicating whether default values should be used
- Returns:
- a new Builder
 
- 
newBuilderCreates a newParentbuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
- from- the- Parentinstance to use as a basis
- Returns:
- a new Builder
 
- 
newBuilderCreates a newParentbuilder instance using the specified object as a basis.- Parameters:
- from- the- Parentinstance to use as a basis
- forceCopy- the boolean indicating if a copy should be forced
- Returns:
- a new Builder
 
- 
getId- Returns:
- the id as groupId:artifactId:version
 
- 
toString
 
-