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 Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create Model instances. -
Method Summary
Modifier 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.getLocation(Object key) Gets the location of the specified field in the input source.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.ModelBase
getDependencies, getDependencyManagement, getDistributionManagement, getModules, getPluginRepositories, getProperties, getReporting, getRepositories, newBuilder, newBuilder
-
Method Details
-
getModelEncoding
-
getPomFile
Originating POM file- Returns:
- a
Path
-
getModelVersion
Declares to which version of project descriptor this POM conforms.- Returns:
- a
String
-
getParent
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:
- a
Parent
-
getGroupId
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:
- a
String
-
getArtifactId
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:
- a
String
-
getVersion
The current version of the artifact produced by this project.- Returns:
- a
String
-
getPackaging
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:
- a
String
-
getName
The full name of the project.- Returns:
- a
String
-
getDescription
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:
- a
String
-
getUrl
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:
- a
String
-
getChildProjectUrlInheritAppendPath
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:
- a
String
-
getInceptionYear
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:
- a
String
-
getOrganization
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:
- a
Organization
-
getLicenses
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.- Returns:
- a
List<License>
-
getDevelopers
Describes the committers of a project.- Returns:
- a
List<Developer>
-
getContributors
Describes the contributors to a project that are not yet committers.- Returns:
- a
List<Contributor>
-
getMailingLists
Contains information about a project's mailing lists.- Returns:
- a
List<MailingList>
-
getPrerequisites
Describes the prerequisites in the build environment for this project.- Returns:
- a
Prerequisites
-
getScm
Specification for the SCM used by the project, such as CVS, Subversion, etc.- Returns:
- a
Scm
-
getIssueManagement
The project's issue management system information.- Returns:
- a
IssueManagement
-
getCiManagement
The project's continuous integration information.- Returns:
- a
CiManagement
-
getBuild
Information required to build the project.- Returns:
- a
Build
-
getProfiles
A listing of project-local build profiles which will modify the build process when activated.- Returns:
- a
List<Profile>
-
getLocation
Gets the location of the specified field in the input source.- Specified by:
getLocationin interfaceInputLocationTracker- Overrides:
getLocationin classModelBase
-
with
Creates a new builder with this object as the basis. -
withModules
Creates a newModelinstance using the specified modules.- Overrides:
withModulesin classModelBase- Parameters:
modules- the newCollection<String>to use- Returns:
- a
Modelwith the specified modules
-
withDistributionManagement
Creates a newModelinstance using the specified distributionManagement.- Overrides:
withDistributionManagementin classModelBase- Parameters:
distributionManagement- the newDistributionManagementto use- Returns:
- a
Modelwith the specified distributionManagement
-
withProperties
Creates a newModelinstance using the specified properties.- Overrides:
withPropertiesin classModelBase- Parameters:
properties- the newMap<String, String>to use- Returns:
- a
Modelwith the specified properties
-
withDependencyManagement
Creates a newModelinstance using the specified dependencyManagement.- Overrides:
withDependencyManagementin classModelBase- Parameters:
dependencyManagement- the newDependencyManagementto use- Returns:
- a
Modelwith the specified dependencyManagement
-
withDependencies
Creates a newModelinstance using the specified dependencies.- Overrides:
withDependenciesin classModelBase- Parameters:
dependencies- the newCollection<Dependency>to use- Returns:
- a
Modelwith the specified dependencies
-
withRepositories
Creates a newModelinstance using the specified repositories.- Overrides:
withRepositoriesin classModelBase- Parameters:
repositories- the newCollection<Repository>to use- Returns:
- a
Modelwith the specified repositories
-
withPluginRepositories
Creates a newModelinstance using the specified pluginRepositories.- Overrides:
withPluginRepositoriesin classModelBase- Parameters:
pluginRepositories- the newCollection<Repository>to use- Returns:
- a
Modelwith the specified pluginRepositories
-
withReporting
Creates a newModelinstance using the specified reporting.- Overrides:
withReportingin classModelBase- Parameters:
reporting- the newReportingto use- Returns:
- a
Modelwith the specified reporting
-
withPomFile
Creates a newModelinstance using the specified pomFile.- Parameters:
pomFile- the newPathto use- Returns:
- a
Modelwith the specified pomFile
-
withModelVersion
Creates a newModelinstance using the specified modelVersion.- Parameters:
modelVersion- the newStringto use- Returns:
- a
Modelwith the specified modelVersion
-
withParent
Creates a newModelinstance using the specified parent.- Parameters:
parent- the newParentto use- Returns:
- a
Modelwith the specified parent
-
withGroupId
Creates a newModelinstance using the specified groupId.- Parameters:
groupId- the newStringto use- Returns:
- a
Modelwith the specified groupId
-
withArtifactId
Creates a newModelinstance using the specified artifactId.- Parameters:
artifactId- the newStringto use- Returns:
- a
Modelwith the specified artifactId
-
withVersion
Creates a newModelinstance using the specified version.- Parameters:
version- the newStringto use- Returns:
- a
Modelwith the specified version
-
withPackaging
Creates a newModelinstance using the specified packaging.- Parameters:
packaging- the newStringto use- Returns:
- a
Modelwith the specified packaging
-
withName
Creates a newModelinstance using the specified name.- Parameters:
name- the newStringto use- Returns:
- a
Modelwith the specified name
-
withDescription
Creates a newModelinstance using the specified description.- Parameters:
description- the newStringto use- Returns:
- a
Modelwith the specified description
-
withUrl
Creates a newModelinstance using the specified url.- Parameters:
url- the newStringto use- Returns:
- a
Modelwith the specified url
-
withChildProjectUrlInheritAppendPath
Creates a newModelinstance using the specified childProjectUrlInheritAppendPath.- Parameters:
childProjectUrlInheritAppendPath- the newStringto use- Returns:
- a
Modelwith the specified childProjectUrlInheritAppendPath
-
withInceptionYear
Creates a newModelinstance using the specified inceptionYear.- Parameters:
inceptionYear- the newStringto use- Returns:
- a
Modelwith the specified inceptionYear
-
withOrganization
Creates a newModelinstance using the specified organization.- Parameters:
organization- the newOrganizationto use- Returns:
- a
Modelwith the specified organization
-
withLicenses
Creates a newModelinstance using the specified licenses.- Parameters:
licenses- the newCollection<License>to use- Returns:
- a
Modelwith the specified licenses
-
withDevelopers
Creates a newModelinstance using the specified developers.- Parameters:
developers- the newCollection<Developer>to use- Returns:
- a
Modelwith the specified developers
-
withContributors
Creates a newModelinstance using the specified contributors.- Parameters:
contributors- the newCollection<Contributor>to use- Returns:
- a
Modelwith the specified contributors
-
withMailingLists
Creates a newModelinstance using the specified mailingLists.- Parameters:
mailingLists- the newCollection<MailingList>to use- Returns:
- a
Modelwith the specified mailingLists
-
withPrerequisites
Creates a newModelinstance using the specified prerequisites.- Parameters:
prerequisites- the newPrerequisitesto use- Returns:
- a
Modelwith the specified prerequisites
-
withScm
Creates a newModelinstance using the specified scm.- Parameters:
scm- the newScmto use- Returns:
- a
Modelwith the specified scm
-
withIssueManagement
Creates a newModelinstance using the specified issueManagement.- Parameters:
issueManagement- the newIssueManagementto use- Returns:
- a
Modelwith the specified issueManagement
-
withCiManagement
Creates a newModelinstance using the specified ciManagement.- Parameters:
ciManagement- the newCiManagementto use- Returns:
- a
Modelwith the specified ciManagement
-
withBuild
Creates a newModelinstance using the specified build.- Parameters:
build- the newBuildto use- Returns:
- a
Modelwith the specified build
-
withProfiles
Creates a newModelinstance using the specified profiles.- Parameters:
profiles- the newCollection<Profile>to use- Returns:
- a
Modelwith the specified profiles
-
newInstance
Creates a newModelinstance. Equivalent tonewInstance( true ).- Returns:
- a new
Model - See Also:
-
newInstance
Creates 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
-
newBuilder
Creates a newModelbuilder instance. Equivalent tonewBuilder( true ).- Returns:
- a new
Builder - See Also:
-
newBuilder
Creates a newModelbuilder instance using default values or not.- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newModelbuilder instance using the specified object as a basis. Equivalent tonewBuilder( from, false ).- Parameters:
from- theModelinstance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newModelbuilder instance using the specified object as a basis.- Parameters:
from- theModelinstance to use as a basisforceCopy- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
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
- Returns:
- the model id as
groupId:artifactId:packaging:version
-
toString
-
isChildProjectUrlInheritAppendPath
public boolean isChildProjectUrlInheritAppendPath()
-