org.apache.maven.model
Class Parent

java.lang.Object
  extended by org.apache.maven.model.Parent
All Implemented Interfaces:
Serializable, Cloneable, InputLocationTracker

public class Parent
extends Object
implements Serializable, Cloneable, 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.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
Parent()
           
 
Method Summary
 Parent clone()
          Method clone.
 String getArtifactId()
          Get the artifact id of the parent project to inherit from.
 String getGroupId()
          Get the group id of the parent project to inherit from.
 String getId()
           
 InputLocation getLocation(Object key)
          Gets the location of the specified field in the input source.
 String getRelativePath()
          Get the relative path of the parent pom.xml file within the check out.
 String getVersion()
          Get the version of the parent project to inherit.
 void setArtifactId(String artifactId)
          Set the artifact id of the parent project to inherit from.
 void setGroupId(String groupId)
          Set the group id of the parent project to inherit from.
 void setLocation(Object key, InputLocation location)
          Sets the location of the specified field.
 void setRelativePath(String relativePath)
          Set the relative path of the parent pom.xml file within the check out.
 void setVersion(String version)
          Set the version of the parent project to inherit.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Parent

public Parent()
Method Detail

clone

public Parent clone()
Method clone.

Overrides:
clone in class Object
Returns:
Parent

getArtifactId

public String getArtifactId()
Get the artifact id of the parent project to inherit from.

Returns:
String

getGroupId

public String getGroupId()
Get the group id of the parent project to inherit from.

Returns:
String

getLocation

public InputLocation getLocation(Object key)
Description copied from interface: InputLocationTracker
Gets the location of the specified field in the input source.

Specified by:
getLocation in interface InputLocationTracker
Parameters:
key -
Returns:
InputLocation

getRelativePath

public String getRelativePath()
Get the relative path of the parent pom.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:
String

getVersion

public String getVersion()
Get the version of the parent project to inherit.

Returns:
String

setArtifactId

public void setArtifactId(String artifactId)
Set the artifact id of the parent project to inherit from.

Parameters:
artifactId -

setGroupId

public void setGroupId(String groupId)
Set the group id of the parent project to inherit from.

Parameters:
groupId -

setLocation

public void setLocation(Object key,
                        InputLocation location)
Description copied from interface: InputLocationTracker
Sets the location of the specified field.

Specified by:
setLocation in interface InputLocationTracker
Parameters:
key -
location -

setRelativePath

public void setRelativePath(String relativePath)
Set the relative path of the parent pom.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.

Parameters:
relativePath -

setVersion

public void setVersion(String version)
Set the version of the parent project to inherit.

Parameters:
version -

getId

public String getId()
Returns:
the id as groupId:artifactId:version

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.