Package org.apache.maven.model
Class Model
- java.lang.Object
-
- org.apache.maven.model.ModelBase
-
- org.apache.maven.model.Model
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,InputLocationTracker
public class Model extends ModelBase implements java.io.Serializable, java.lang.Cloneable
The<project>element is the root of the descriptor. The following table lists all of the possible child elements.- Version:
- $Revision$ $Date$
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringartifactIdThe identifier for this artifact that is unique within the group given by the group ID.private BuildbuildInformation required to build the project.private java.lang.StringchildProjectUrlInheritAppendPathWhen children inherit from project's url, append path or not? Note: While the type of this field isStringfor technical reasons, the semantic type is actuallyBoolean
Default value is:true
Since: Maven 3.6.1 .private CiManagementciManagementThe project's continuous integration information.private java.util.List<Contributor>contributorsField contributors.private java.lang.StringdescriptionA detailed description of the project, used by Maven whenever it needs to describe the project, such as on the web site.private java.util.List<Developer>developersField developers.private java.lang.StringgroupIdA universally unique identifier for a project.private java.lang.StringinceptionYearThe year of the project's inception, specified with 4 digits.private IssueManagementissueManagementThe project's issue management system information.private java.util.List<License>licensesField licenses.private java.util.List<MailingList>mailingListsField mailingLists.private java.lang.StringmodelEncodingField modelEncoding.private java.lang.StringmodelVersionDeclares to which version of project descriptor this POM conforms.private java.lang.StringnameThe full name of the project.private OrganizationorganizationThis element describes various attributes of the organization to which the project belongs.private java.lang.StringpackagingThe type of artifact this project produces, for examplejarwarearpom.private ParentparentThe location of the parent project, if one exists.private java.io.FilepomFileThe POM from which this model originated.private PrerequisitesprerequisitesDescribes the prerequisites in the build environment for this project.private java.util.List<Profile>profilesField profiles.private ScmscmSpecification for the SCM used by the project, such as CVS, Subversion, etc.private java.lang.StringurlThe URL to the project's homepage.private java.lang.StringversionThe current version of the artifact produced by this project.
-
Constructor Summary
Constructors Constructor Description Model()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddContributor(Contributor contributor)Method addContributor.voidaddDeveloper(Developer developer)Method addDeveloper.voidaddLicense(License license)Method addLicense.voidaddMailingList(MailingList mailingList)Method addMailingList.voidaddProfile(Profile profile)Method addProfile.Modelclone()Method clone.private voidcloneHook(Model copy)java.lang.StringgetArtifactId()Get the identifier for this artifact that is unique within the group given by the group ID.BuildgetBuild()Get information required to build the project.java.lang.StringgetChildProjectUrlInheritAppendPath()Get when children inherit from project's url, append path or not? Note: While the type of this field isStringfor technical reasons, the semantic type is actuallyBoolean
Default value is:true
Since: Maven 3.6.1.CiManagementgetCiManagement()Get the project's continuous integration information.java.util.List<Contributor>getContributors()Method getContributors.java.lang.StringgetDescription()Get a detailed description of the project, used by Maven whenever it needs to describe the project, such as on the web site.java.util.List<Developer>getDevelopers()Method getDevelopers.java.lang.StringgetGroupId()Get a universally unique identifier for a project.java.lang.StringgetId()java.lang.StringgetInceptionYear()Get the year of the project's inception, specified with 4 digits.IssueManagementgetIssueManagement()Get the project's issue management system information.java.util.List<License>getLicenses()Method getLicenses.java.util.List<MailingList>getMailingLists()Method getMailingLists.java.lang.StringgetModelEncoding()Get the modelEncoding field.java.lang.StringgetModelVersion()Get declares to which version of project descriptor this POM conforms.java.lang.StringgetName()Get the full name of the project.OrganizationgetOrganization()Get this element describes various attributes of the organization to which the project belongs.java.lang.StringgetPackaging()Get the type of artifact this project produces, for examplejarwarearpom.ParentgetParent()Get the location of the parent project, if one exists.java.io.FilegetPomFile()Gets the POM file for the corresponding project (if any).PrerequisitesgetPrerequisites()Get describes the prerequisites in the build environment for this project.java.util.List<Profile>getProfiles()Method getProfiles.java.io.FilegetProjectDirectory()Gets the base directory for the corresponding project (if any).ScmgetScm()Get specification for the SCM used by the project, such as CVS, Subversion, etc.java.lang.StringgetUrl()Get the URL to the project's homepage.java.lang.StringgetVersion()Get the current version of the artifact produced by this project.booleanisChildProjectUrlInheritAppendPath()voidremoveContributor(Contributor contributor)Method removeContributor.voidremoveDeveloper(Developer developer)Method removeDeveloper.voidremoveLicense(License license)Method removeLicense.voidremoveMailingList(MailingList mailingList)Method removeMailingList.voidremoveProfile(Profile profile)Method removeProfile.voidsetArtifactId(java.lang.String artifactId)Set the identifier for this artifact that is unique within the group given by the group ID.voidsetBuild(Build build)Set information required to build the project.voidsetChildProjectUrlInheritAppendPath(boolean childProjectUrlInheritAppendPath)voidsetChildProjectUrlInheritAppendPath(java.lang.String childProjectUrlInheritAppendPath)Set when children inherit from project's url, append path or not? Note: While the type of this field isStringfor technical reasons, the semantic type is actuallyBoolean
Default value is:true
Since: Maven 3.6.1.voidsetCiManagement(CiManagement ciManagement)Set the project's continuous integration information.voidsetContributors(java.util.List<Contributor> contributors)Set describes the contributors to a project that are not yet committers.voidsetDescription(java.lang.String description)Set a detailed description of the project, used by Maven whenever it needs to describe the project, such as on the web site.voidsetDevelopers(java.util.List<Developer> developers)Set describes the committers of a project.voidsetGroupId(java.lang.String groupId)Set a universally unique identifier for a project.voidsetInceptionYear(java.lang.String inceptionYear)Set the year of the project's inception, specified with 4 digits.voidsetIssueManagement(IssueManagement issueManagement)Set the project's issue management system information.voidsetLicenses(java.util.List<License> licenses)Set this element describes all of the licenses for this project.voidsetMailingLists(java.util.List<MailingList> mailingLists)Set contains information about a project's mailing lists.voidsetModelEncoding(java.lang.String modelEncoding)Set the modelEncoding field.voidsetModelVersion(java.lang.String modelVersion)Set declares to which version of project descriptor this POM conforms.voidsetName(java.lang.String name)Set the full name of the project.voidsetOrganization(Organization organization)Set this element describes various attributes of the organization to which the project belongs.voidsetPackaging(java.lang.String packaging)Set the type of artifact this project produces, for examplejarwarearpom.voidsetParent(Parent parent)Set the location of the parent project, if one exists.voidsetPomFile(java.io.File pomFile)voidsetPrerequisites(Prerequisites prerequisites)Set describes the prerequisites in the build environment for this project.voidsetProfiles(java.util.List<Profile> profiles)Set a listing of project-local build profiles which will modify the build process when activated.voidsetScm(Scm scm)Set specification for the SCM used by the project, such as CVS, Subversion, etc.voidsetUrl(java.lang.String url)Set the URL to the project's homepage.voidsetVersion(java.lang.String version)Set the current version of the artifact produced by this project.java.lang.StringtoString()-
Methods inherited from class org.apache.maven.model.ModelBase
addDependency, addModule, addPluginRepository, addProperty, addRepository, getDependencies, getDependencyManagement, getDistributionManagement, getLocation, getModules, getPluginRepositories, getProperties, getReporting, getReports, getRepositories, removeDependency, removeModule, removePluginRepository, removeRepository, setDependencies, setDependencyManagement, setDistributionManagement, setLocation, setModules, setOtherLocation, setPluginRepositories, setProperties, setReporting, setReports, setRepositories
-
-
-
-
Field Detail
-
modelVersion
private java.lang.String modelVersion
Declares to which version of project descriptor this POM conforms.
-
parent
private Parent parent
The location of the parent project, if one exists. Values from the parent project will be the default for this project if they are left unspecified. The location is given as a group ID, artifact ID and version.
-
groupId
private java.lang.String groupId
A universally unique identifier for a project. It is normal to use a fully-qualified package name to distinguish it from other projects with a similar name (eg.org.apache.maven).
-
artifactId
private java.lang.String artifactId
The identifier for this artifact that is unique within the group given by the group ID. An artifact is something that is either produced or used by a project. Examples of artifacts produced by Maven for a project include: JARs, source and binary distributions, and WARs.
-
version
private java.lang.String version
The current version of the artifact produced by this project.
-
packaging
private java.lang.String packaging
The type of artifact this project produces, for examplejarwarearpom. Plugins can create their own packaging, and therefore their own packaging types, so this list does not contain all possible types.
-
name
private java.lang.String name
The full name of the project.
-
description
private java.lang.String description
A detailed description of the project, used by Maven whenever it needs to describe the project, such as on the web site. While this element can be specified as CDATA to enable the use of HTML tags within the description, it is discouraged to allow plain text representation. If you need to modify the index page of the generated web site, you are able to specify your own instead of adjusting this text.
-
url
private java.lang.String url
The URL to the project's homepage.
Default value is: parent value [+ path adjustment] + (artifactId or project.directory property), or just parent value if project'schild.project.url.inherit.append.path="false"
-
childProjectUrlInheritAppendPath
private java.lang.String childProjectUrlInheritAppendPath
When children inherit from project's url, append path or not? Note: While the type of this field isStringfor technical reasons, the semantic type is actuallyBoolean
Default value is:true
Since: Maven 3.6.1 .
-
inceptionYear
private java.lang.String inceptionYear
The year of the project's inception, specified with 4 digits. This value is used when generating copyright notices as well as being informational.
-
organization
private Organization organization
This element describes various attributes of the organization to which the project belongs. These attributes are utilized when documentation is created (for copyright notices and links).
-
licenses
private java.util.List<License> licenses
Field licenses.
-
developers
private java.util.List<Developer> developers
Field developers.
-
contributors
private java.util.List<Contributor> contributors
Field contributors.
-
mailingLists
private java.util.List<MailingList> mailingLists
Field mailingLists.
-
prerequisites
private Prerequisites prerequisites
Describes the prerequisites in the build environment for this project.
-
scm
private Scm scm
Specification for the SCM used by the project, such as CVS, Subversion, etc.
-
issueManagement
private IssueManagement issueManagement
The project's issue management system information.
-
ciManagement
private CiManagement ciManagement
The project's continuous integration information.
-
build
private Build build
Information required to build the project.
-
profiles
private java.util.List<Profile> profiles
Field profiles.
-
modelEncoding
private java.lang.String modelEncoding
Field modelEncoding.
-
pomFile
private java.io.File pomFile
The POM from which this model originated. This is transient runtime state and therefore not managed by Modello.
-
-
Method Detail
-
addContributor
public void addContributor(Contributor contributor)
Method addContributor.- Parameters:
contributor-
-
addDeveloper
public void addDeveloper(Developer developer)
Method addDeveloper.- Parameters:
developer-
-
addLicense
public void addLicense(License license)
Method addLicense.- Parameters:
license-
-
addMailingList
public void addMailingList(MailingList mailingList)
Method addMailingList.- Parameters:
mailingList-
-
addProfile
public void addProfile(Profile profile)
Method addProfile.- Parameters:
profile-
-
getArtifactId
public java.lang.String getArtifactId()
Get the identifier for this artifact that is unique within the group given by the group ID. An artifact is something that is either produced or used by a project. Examples of artifacts produced by Maven for a project include: JARs, source and binary distributions, and WARs.- Returns:
- String
-
getBuild
public Build getBuild()
Get information required to build the project.- Returns:
- Build
-
getChildProjectUrlInheritAppendPath
public java.lang.String getChildProjectUrlInheritAppendPath()
Get when children inherit from project's url, append path or not? Note: While the type of this field isStringfor technical reasons, the semantic type is actuallyBoolean
Default value is:true
Since: Maven 3.6.1.- Returns:
- String
-
getCiManagement
public CiManagement getCiManagement()
Get the project's continuous integration information.- Returns:
- CiManagement
-
getContributors
public java.util.List<Contributor> getContributors()
Method getContributors.- Returns:
- List
-
getDescription
public java.lang.String getDescription()
Get a detailed description of the project, used by Maven whenever it needs to describe the project, such as on the web site. While this element can be specified as CDATA to enable the use of HTML tags within the description, it is discouraged to allow plain text representation. If you need to modify the index page of the generated web site, you are able to specify your own instead of adjusting this text.- Returns:
- String
-
getDevelopers
public java.util.List<Developer> getDevelopers()
Method getDevelopers.- Returns:
- List
-
getGroupId
public java.lang.String getGroupId()
Get a universally unique identifier for a project. It is normal to use a fully-qualified package name to distinguish it from other projects with a similar name (eg.org.apache.maven).- Returns:
- String
-
getInceptionYear
public java.lang.String getInceptionYear()
Get the year of the project's inception, specified with 4 digits. This value is used when generating copyright notices as well as being informational.- Returns:
- String
-
getIssueManagement
public IssueManagement getIssueManagement()
Get the project's issue management system information.- Returns:
- IssueManagement
-
getLicenses
public java.util.List<License> getLicenses()
Method getLicenses.- Returns:
- List
-
getMailingLists
public java.util.List<MailingList> getMailingLists()
Method getMailingLists.- Returns:
- List
-
getModelEncoding
public java.lang.String getModelEncoding()
Get the modelEncoding field.- Returns:
- String
-
getModelVersion
public java.lang.String getModelVersion()
Get declares to which version of project descriptor this POM conforms.- Returns:
- String
-
getName
public java.lang.String getName()
Get the full name of the project.- Returns:
- String
-
getOrganization
public Organization getOrganization()
Get this element describes various attributes of the organization to which the project belongs. These attributes are utilized when documentation is created (for copyright notices and links).- Returns:
- Organization
-
getPackaging
public java.lang.String getPackaging()
Get the type of artifact this project produces, for examplejarwarearpom. Plugins can create their own packaging, and therefore their own packaging types, so this list does not contain all possible types.- Returns:
- String
-
getParent
public Parent getParent()
Get the location of the parent project, if one exists. Values from the parent project will be the default for this project if they are left unspecified. The location is given as a group ID, artifact ID and version.- Returns:
- Parent
-
getPrerequisites
public Prerequisites getPrerequisites()
Get describes the prerequisites in the build environment for this project.- Returns:
- Prerequisites
-
getProfiles
public java.util.List<Profile> getProfiles()
Method getProfiles.- Returns:
- List
-
getScm
public Scm getScm()
Get specification for the SCM used by the project, such as CVS, Subversion, etc.- Returns:
- Scm
-
getUrl
public java.lang.String getUrl()
Get the URL to the project's homepage.
Default value is: parent value [+ path adjustment] + (artifactId or project.directory property), or just parent value if project'schild.project.url.inherit.append.path="false"- Returns:
- String
-
getVersion
public java.lang.String getVersion()
Get the current version of the artifact produced by this project.- Returns:
- String
-
removeContributor
public void removeContributor(Contributor contributor)
Method removeContributor.- Parameters:
contributor-
-
removeDeveloper
public void removeDeveloper(Developer developer)
Method removeDeveloper.- Parameters:
developer-
-
removeLicense
public void removeLicense(License license)
Method removeLicense.- Parameters:
license-
-
removeMailingList
public void removeMailingList(MailingList mailingList)
Method removeMailingList.- Parameters:
mailingList-
-
removeProfile
public void removeProfile(Profile profile)
Method removeProfile.- Parameters:
profile-
-
setArtifactId
public void setArtifactId(java.lang.String artifactId)
Set the identifier for this artifact that is unique within the group given by the group ID. An artifact is something that is either produced or used by a project. Examples of artifacts produced by Maven for a project include: JARs, source and binary distributions, and WARs.- Parameters:
artifactId-
-
setBuild
public void setBuild(Build build)
Set information required to build the project.- Parameters:
build-
-
setChildProjectUrlInheritAppendPath
public void setChildProjectUrlInheritAppendPath(java.lang.String childProjectUrlInheritAppendPath)
Set when children inherit from project's url, append path or not? Note: While the type of this field isStringfor technical reasons, the semantic type is actuallyBoolean
Default value is:true
Since: Maven 3.6.1.- Parameters:
childProjectUrlInheritAppendPath-
-
setCiManagement
public void setCiManagement(CiManagement ciManagement)
Set the project's continuous integration information.- Parameters:
ciManagement-
-
setContributors
public void setContributors(java.util.List<Contributor> contributors)
Set describes the contributors to a project that are not yet committers.- Parameters:
contributors-
-
setDescription
public void setDescription(java.lang.String description)
Set a detailed description of the project, used by Maven whenever it needs to describe the project, such as on the web site. While this element can be specified as CDATA to enable the use of HTML tags within the description, it is discouraged to allow plain text representation. If you need to modify the index page of the generated web site, you are able to specify your own instead of adjusting this text.- Parameters:
description-
-
setDevelopers
public void setDevelopers(java.util.List<Developer> developers)
Set describes the committers of a project.- Parameters:
developers-
-
setGroupId
public void setGroupId(java.lang.String groupId)
Set a universally unique identifier for a project. It is normal to use a fully-qualified package name to distinguish it from other projects with a similar name (eg.org.apache.maven).- Parameters:
groupId-
-
setInceptionYear
public void setInceptionYear(java.lang.String inceptionYear)
Set the year of the project's inception, specified with 4 digits. This value is used when generating copyright notices as well as being informational.- Parameters:
inceptionYear-
-
setIssueManagement
public void setIssueManagement(IssueManagement issueManagement)
Set the project's issue management system information.- Parameters:
issueManagement-
-
setLicenses
public void setLicenses(java.util.List<License> licenses)
Set this element describes all of the licenses for this project. Each license is described by alicenseelement, which is then described by additional elements. Projects should only list the license(s) that applies to the project and not the licenses that apply to dependencies. If multiple licenses are listed, it is assumed that the user can select any of them, not that they must accept all.- Parameters:
licenses-
-
setMailingLists
public void setMailingLists(java.util.List<MailingList> mailingLists)
Set contains information about a project's mailing lists.- Parameters:
mailingLists-
-
setModelEncoding
public void setModelEncoding(java.lang.String modelEncoding)
Set the modelEncoding field.- Parameters:
modelEncoding-
-
setModelVersion
public void setModelVersion(java.lang.String modelVersion)
Set declares to which version of project descriptor this POM conforms.- Parameters:
modelVersion-
-
setName
public void setName(java.lang.String name)
Set the full name of the project.- Parameters:
name-
-
setOrganization
public void setOrganization(Organization organization)
Set this element describes various attributes of the organization to which the project belongs. These attributes are utilized when documentation is created (for copyright notices and links).- Parameters:
organization-
-
setPackaging
public void setPackaging(java.lang.String packaging)
Set the type of artifact this project produces, for examplejarwarearpom. Plugins can create their own packaging, and therefore their own packaging types, so this list does not contain all possible types.- Parameters:
packaging-
-
setParent
public void setParent(Parent parent)
Set the location of the parent project, if one exists. Values from the parent project will be the default for this project if they are left unspecified. The location is given as a group ID, artifact ID and version.- Parameters:
parent-
-
setPrerequisites
public void setPrerequisites(Prerequisites prerequisites)
Set describes the prerequisites in the build environment for this project.- Parameters:
prerequisites-
-
setProfiles
public void setProfiles(java.util.List<Profile> profiles)
Set a listing of project-local build profiles which will modify the build process when activated.- Parameters:
profiles-
-
setScm
public void setScm(Scm scm)
Set specification for the SCM used by the project, such as CVS, Subversion, etc.- Parameters:
scm-
-
setUrl
public void setUrl(java.lang.String url)
Set the URL to the project's homepage.
Default value is: parent value [+ path adjustment] + (artifactId or project.directory property), or just parent value if project'schild.project.url.inherit.append.path="false"- Parameters:
url-
-
setVersion
public void setVersion(java.lang.String version)
Set the current version of the artifact produced by this project.- Parameters:
version-
-
cloneHook
private void cloneHook(Model copy)
-
getPomFile
public java.io.File getPomFile()
Gets the POM file for the corresponding project (if any).- Returns:
- The POM file from which this model originated or
nullif this model does not belong to a local project (e.g. describes the metadata of some artifact from the repository).
-
setPomFile
public void setPomFile(java.io.File pomFile)
-
getProjectDirectory
public java.io.File getProjectDirectory()
Gets the base directory for the corresponding project (if any).- Returns:
- The base directory for the corresponding project or
nullif this model does not belong to a local project (e.g. describes the metadata of some artifact from the repository).
-
getId
public java.lang.String getId()
- Returns:
- the model id as
groupId:artifactId:packaging:version
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isChildProjectUrlInheritAppendPath
public boolean isChildProjectUrlInheritAppendPath()
-
setChildProjectUrlInheritAppendPath
public void setChildProjectUrlInheritAppendPath(boolean childProjectUrlInheritAppendPath)
-
-