Package org.apache.maven.api.model
Class Model
java.lang.Object
org.apache.maven.api.model.ModelBase
org.apache.maven.api.model.Model
- All Implemented Interfaces:
- Serializable,- InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class Model
extends ModelBase
implements Serializable, InputLocationTracker
The 
<project> element is the root of the descriptor.
 The following table lists all of the possible child elements.- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create Model instances.
- 
Method SummaryModifier and TypeMethodDescriptionThe identifier for this artifact that is unique within the group given by the group ID.getBuild()Information required to build the project.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.1The project's continuous integration information.Describes the contributors to a project that are not yet committers.A detailed description of the project, used by Maven whenever it needs to describe the project, such as on the web site.Describes the committers of a project.A universally unique identifier for a project.getId()The year of the project's inception, specified with 4 digits.The project's issue management system information.This element describes all of the licenses for this project.Contains information about a project's mailing lists.Declares to which version of project descriptor this POM conforms.getName()The full name of the project.This element describes various attributes of the organization to which the project belongs.The type of artifact this project produces, for examplejarwarearpom.The location of the parent project, if one exists.Originating POM fileDescribes the prerequisites in the build environment for this project.A listing of project-local build profiles which will modify the build process when activated.Gets the base directory for the corresponding project (if any).getScm()Specification for the SCM used by the project, such as CVS, Subversion, etc.getUrl()The URL to the project's homepage.The current version of the artifact produced by this project.booleanstatic Model.BuilderCreates a newModelbuilder instance.static Model.BuildernewBuilder(boolean withDefaults) Creates a newModelbuilder instance using default values or not.static Model.BuildernewBuilder(Model from) Creates a newModelbuilder instance using the specified object as a basis.static Model.BuildernewBuilder(Model from, boolean forceCopy) Creates a newModelbuilder instance using the specified object as a basis.static ModelCreates a newModelinstance.static ModelnewInstance(boolean withDefaults) Creates a newModelinstance using default values or not.toString()with()Creates a new builder with this object as the basis.withArtifactId(String artifactId) Creates a newModelinstance using the specified artifactId.Creates a newModelinstance using the specified build.withChildProjectUrlInheritAppendPath(String childProjectUrlInheritAppendPath) Creates a newModelinstance using the specified childProjectUrlInheritAppendPath.withCiManagement(CiManagement ciManagement) Creates a newModelinstance using the specified ciManagement.withContributors(Collection<Contributor> contributors) Creates a newModelinstance using the specified contributors.withDependencies(Collection<Dependency> dependencies) Creates a newModelinstance using the specified dependencies.withDependencyManagement(DependencyManagement dependencyManagement) Creates a newModelinstance using the specified dependencyManagement.withDescription(String description) Creates a newModelinstance using the specified description.withDevelopers(Collection<Developer> developers) Creates a newModelinstance using the specified developers.withDistributionManagement(DistributionManagement distributionManagement) Creates a newModelinstance using the specified distributionManagement.withGroupId(String groupId) Creates a newModelinstance using the specified groupId.withInceptionYear(String inceptionYear) Creates a newModelinstance using the specified inceptionYear.withIssueManagement(IssueManagement issueManagement) Creates a newModelinstance using the specified issueManagement.withLicenses(Collection<License> licenses) Creates a newModelinstance using the specified licenses.withMailingLists(Collection<MailingList> mailingLists) Creates a newModelinstance using the specified mailingLists.withModelVersion(String modelVersion) Creates a newModelinstance using the specified modelVersion.withModules(Collection<String> modules) Creates a newModelinstance using the specified modules.Creates a newModelinstance using the specified name.withOrganization(Organization organization) Creates a newModelinstance using the specified organization.withPackaging(String packaging) Creates a newModelinstance using the specified packaging.withParent(Parent parent) Creates a newModelinstance using the specified parent.withPluginRepositories(Collection<Repository> pluginRepositories) Creates a newModelinstance using the specified pluginRepositories.withPomFile(Path pomFile) Creates a newModelinstance using the specified pomFile.withPrerequisites(Prerequisites prerequisites) Creates a newModelinstance using the specified prerequisites.withProfiles(Collection<Profile> profiles) Creates a newModelinstance using the specified profiles.withProperties(Map<String, String> properties) Creates a newModelinstance using the specified properties.withReporting(Reporting reporting) Creates a newModelinstance using the specified reporting.withRepositories(Collection<Repository> repositories) Creates a newModelinstance using the specified repositories.Creates a newModelinstance using the specified scm.Creates a newModelinstance using the specified url.withVersion(String version) Creates a newModelinstance using the specified version.Methods inherited from class org.apache.maven.api.model.ModelBasegetDependencies, getDependencyManagement, getDistributionManagement, getLocation, getModules, getPluginRepositories, getProperties, getReporting, getRepositories, newBuilder, newBuilderMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.maven.api.model.InputLocationTrackergetLocation
- 
Method Details- 
getModelEncoding
- 
getPomFileOriginating POM file- Returns:
- a Path
 
- 
getModelVersionDeclares to which version of project descriptor this POM conforms.- Returns:
- a String
 
- 
getParentThe 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:
- a Parent
 
- 
getGroupIdA 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:
- a String
 
- 
getArtifactIdThe 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:
- a String
 
- 
getVersionThe current version of the artifact produced by this project.- Returns:
- a String
 
- 
getPackagingThe 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:
- a String
 
- 
getNameThe full name of the project.- Returns:
- a String
 
- 
getDescriptionA 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:
- a String
 
- 
getUrlThe 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:
- a String
 
- 
getChildProjectUrlInheritAppendPathWhen 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:
- a String
 
- 
getInceptionYearThe year of the project's inception, specified with 4 digits. This value is used when generating copyright notices as well as being informational.- Returns:
- a String
 
- 
getOrganizationThis 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:
- a Organization
 
- 
getLicensesThis 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.- Returns:
- a List<License>
 
- 
getDevelopersDescribes the committers of a project.- Returns:
- a List<Developer>
 
- 
getContributorsDescribes the contributors to a project that are not yet committers.- Returns:
- a List<Contributor>
 
- 
getMailingListsContains information about a project's mailing lists.- Returns:
- a List<MailingList>
 
- 
getPrerequisitesDescribes the prerequisites in the build environment for this project.- Returns:
- a Prerequisites
 
- 
getScmSpecification for the SCM used by the project, such as CVS, Subversion, etc.- Returns:
- a Scm
 
- 
getIssueManagementThe project's issue management system information.- Returns:
- a IssueManagement
 
- 
getCiManagementThe project's continuous integration information.- Returns:
- a CiManagement
 
- 
getBuildInformation required to build the project.- Returns:
- a Build
 
- 
getProfilesA listing of project-local build profiles which will modify the build process when activated.- Returns:
- a List<Profile>
 
- 
withCreates a new builder with this object as the basis.
- 
withModulesCreates a newModelinstance using the specified modules.- Overrides:
- withModulesin class- ModelBase
- Parameters:
- modules- the new- Collection<String>to use
- Returns:
- a Modelwith the specified modules
 
- 
withDistributionManagementCreates a newModelinstance using the specified distributionManagement.- Overrides:
- withDistributionManagementin class- ModelBase
- Parameters:
- distributionManagement- the new- DistributionManagementto use
- Returns:
- a Modelwith the specified distributionManagement
 
- 
withPropertiesCreates a newModelinstance using the specified properties.- Overrides:
- withPropertiesin class- ModelBase
- Parameters:
- properties- the new- Map<String, String>to use
- Returns:
- a Modelwith the specified properties
 
- 
withDependencyManagementCreates a newModelinstance using the specified dependencyManagement.- Overrides:
- withDependencyManagementin class- ModelBase
- Parameters:
- dependencyManagement- the new- DependencyManagementto use
- Returns:
- a Modelwith the specified dependencyManagement
 
- 
withDependenciesCreates a newModelinstance using the specified dependencies.- Overrides:
- withDependenciesin class- ModelBase
- Parameters:
- dependencies- the new- Collection<Dependency>to use
- Returns:
- a Modelwith the specified dependencies
 
- 
withRepositoriesCreates a newModelinstance using the specified repositories.- Overrides:
- withRepositoriesin class- ModelBase
- Parameters:
- repositories- the new- Collection<Repository>to use
- Returns:
- a Modelwith the specified repositories
 
- 
withPluginRepositoriesCreates a newModelinstance using the specified pluginRepositories.- Overrides:
- withPluginRepositoriesin class- ModelBase
- Parameters:
- pluginRepositories- the new- Collection<Repository>to use
- Returns:
- a Modelwith the specified pluginRepositories
 
- 
withReportingCreates a newModelinstance using the specified reporting.- Overrides:
- withReportingin class- ModelBase
- Parameters:
- reporting- the new- Reportingto use
- Returns:
- a Modelwith the specified reporting
 
- 
withPomFileCreates a newModelinstance using the specified pomFile.- Parameters:
- pomFile- the new- Pathto use
- Returns:
- a Modelwith the specified pomFile
 
- 
withModelVersionCreates a newModelinstance using the specified modelVersion.- Parameters:
- modelVersion- the new- Stringto use
- Returns:
- a Modelwith the specified modelVersion
 
- 
withParentCreates a newModelinstance using the specified parent.- Parameters:
- parent- the new- Parentto use
- Returns:
- a Modelwith the specified parent
 
- 
withGroupIdCreates a newModelinstance using the specified groupId.- Parameters:
- groupId- the new- Stringto use
- Returns:
- a Modelwith the specified groupId
 
- 
withArtifactIdCreates a newModelinstance using the specified artifactId.- Parameters:
- artifactId- the new- Stringto use
- Returns:
- a Modelwith the specified artifactId
 
- 
withVersionCreates a newModelinstance using the specified version.- Parameters:
- version- the new- Stringto use
- Returns:
- a Modelwith the specified version
 
- 
withPackagingCreates a newModelinstance using the specified packaging.- Parameters:
- packaging- the new- Stringto use
- Returns:
- a Modelwith the specified packaging
 
- 
withNameCreates a newModelinstance using the specified name.- Parameters:
- name- the new- Stringto use
- Returns:
- a Modelwith the specified name
 
- 
withDescriptionCreates a newModelinstance using the specified description.- Parameters:
- description- the new- Stringto use
- Returns:
- a Modelwith the specified description
 
- 
withUrlCreates a newModelinstance using the specified url.- Parameters:
- url- the new- Stringto use
- Returns:
- a Modelwith the specified url
 
- 
withChildProjectUrlInheritAppendPathCreates a newModelinstance using the specified childProjectUrlInheritAppendPath.- Parameters:
- childProjectUrlInheritAppendPath- the new- Stringto use
- Returns:
- a Modelwith the specified childProjectUrlInheritAppendPath
 
- 
withInceptionYearCreates a newModelinstance using the specified inceptionYear.- Parameters:
- inceptionYear- the new- Stringto use
- Returns:
- a Modelwith the specified inceptionYear
 
- 
withOrganizationCreates a newModelinstance using the specified organization.- Parameters:
- organization- the new- Organizationto use
- Returns:
- a Modelwith the specified organization
 
- 
withLicensesCreates a newModelinstance using the specified licenses.- Parameters:
- licenses- the new- Collection<License>to use
- Returns:
- a Modelwith the specified licenses
 
- 
withDevelopersCreates a newModelinstance using the specified developers.- Parameters:
- developers- the new- Collection<Developer>to use
- Returns:
- a Modelwith the specified developers
 
- 
withContributorsCreates a newModelinstance using the specified contributors.- Parameters:
- contributors- the new- Collection<Contributor>to use
- Returns:
- a Modelwith the specified contributors
 
- 
withMailingListsCreates a newModelinstance using the specified mailingLists.- Parameters:
- mailingLists- the new- Collection<MailingList>to use
- Returns:
- a Modelwith the specified mailingLists
 
- 
withPrerequisitesCreates a newModelinstance using the specified prerequisites.- Parameters:
- prerequisites- the new- Prerequisitesto use
- Returns:
- a Modelwith the specified prerequisites
 
- 
withScmCreates a newModelinstance using the specified scm.- Parameters:
- scm- the new- Scmto use
- Returns:
- a Modelwith the specified scm
 
- 
withIssueManagementCreates a newModelinstance using the specified issueManagement.- Parameters:
- issueManagement- the new- IssueManagementto use
- Returns:
- a Modelwith the specified issueManagement
 
- 
withCiManagementCreates a newModelinstance using the specified ciManagement.- Parameters:
- ciManagement- the new- CiManagementto use
- Returns:
- a Modelwith the specified ciManagement
 
- 
withBuildCreates a newModelinstance using the specified build.- Parameters:
- build- the new- Buildto use
- Returns:
- a Modelwith the specified build
 
- 
withProfilesCreates a newModelinstance using the specified profiles.- Parameters:
- profiles- the new- Collection<Profile>to use
- Returns:
- a Modelwith the specified profiles
 
- 
newInstanceCreates a newModelinstance. Equivalent tonewInstance( true ).- Returns:
- a new Model
- See Also:
 
- 
newInstanceCreates a newModelinstance using default values or not. Equivalent tonewBuilder( withDefaults ).build().- Parameters:
- withDefaults- the boolean indicating whether default values should be used
- Returns:
- a new Model
 
- 
newBuilderCreates a newModelbuilder instance. Equivalent tonewBuilder( true ).- Returns:
- a new Builder
- See Also:
 
- 
newBuilderCreates a newModelbuilder instance using default values or not.- Parameters:
- withDefaults- the boolean indicating whether default values should be used
- Returns:
- a new Builder
 
- 
newBuilderCreates a newModelbuilder instance using the specified object as a basis. Equivalent tonewBuilder( from, false ).- Parameters:
- from- the- Modelinstance to use as a basis
- Returns:
- a new Builder
 
- 
newBuilderCreates a newModelbuilder instance using the specified object as a basis.- Parameters:
- from- the- Modelinstance to use as a basis
- forceCopy- the boolean indicating if a copy should be forced
- Returns:
- a new Builder
 
- 
getProjectDirectoryGets 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- Returns:
- the model id as groupId:artifactId:packaging:version
 
- 
toString
- 
isChildProjectUrlInheritAppendPathpublic boolean isChildProjectUrlInheritAppendPath()
 
-