@Experimental @Generated @ThreadSafe @Immutable public class Model extends ModelBase implements Serializable, InputLocationTracker
<project>
element is the root of the descriptor.
The following table lists all of the possible child elements.Modifier and Type | Class and Description |
---|---|
static class |
Model.Builder
Builder class used to create Model instances.
|
Modifier and Type | Method and Description |
---|---|
String |
getArtifactId()
The identifier for this artifact that is unique within the group given by the
group ID.
|
Build |
getBuild()
Information required to build the project.
|
String |
getChildProjectUrlInheritAppendPath()
When children inherit from project's url, append path or not? Note: While the type
of this field is
String for technical reasons, the semantic type is actually
Boolean
Default value is: true
Since: Maven 3.6.1 |
CiManagement |
getCiManagement()
The project's continuous integration information.
|
List<Contributor> |
getContributors()
Describes the contributors to a project that are not yet committers.
|
String |
getDescription()
A detailed description of the project, used by Maven whenever it needs to
describe the project, such as on the web site.
|
List<Developer> |
getDevelopers()
Describes the committers of a project.
|
String |
getGroupId()
A universally unique identifier for a project.
|
String |
getId() |
String |
getInceptionYear()
The year of the project's inception, specified with 4 digits.
|
IssueManagement |
getIssueManagement()
The project's issue management system information.
|
List<License> |
getLicenses()
This element describes all of the licenses for this project.
|
InputLocation |
getLocation(Object key)
Gets the location of the specified field in the input source.
|
List<MailingList> |
getMailingLists()
Contains information about a project's mailing lists.
|
String |
getModelEncoding() |
String |
getModelVersion()
Declares to which version of project descriptor this POM conforms.
|
String |
getName()
The full name of the project.
|
Organization |
getOrganization()
This element describes various attributes of the organization to which the
project belongs.
|
String |
getPackaging()
The type of artifact this project produces, for example
jar
war
ear
pom . |
Parent |
getParent()
The location of the parent project, if one exists.
|
Path |
getPomFile()
Originating POM file
|
Prerequisites |
getPrerequisites()
Describes the prerequisites in the build environment for this project.
|
List<Profile> |
getProfiles()
A listing of project-local build profiles which will modify the build process
when activated.
|
Path |
getProjectDirectory()
Gets the base directory for the corresponding project (if any).
|
Scm |
getScm()
Specification for the SCM used by the project, such as CVS, Subversion, etc.
|
String |
getUrl()
The URL to the project's homepage.
|
String |
getVersion()
The current version of the artifact produced by this project.
|
boolean |
isChildProjectUrlInheritAppendPath() |
static Model.Builder |
newBuilder()
Creates a new
Model builder instance. |
static Model.Builder |
newBuilder(boolean withDefaults)
Creates a new
Model builder instance using default values or not. |
static Model.Builder |
newBuilder(Model from)
Creates a new
Model builder instance using the specified object as a basis. |
static Model.Builder |
newBuilder(Model from,
boolean forceCopy)
Creates a new
Model builder instance using the specified object as a basis. |
static Model |
newInstance()
Creates a new
Model instance. |
static Model |
newInstance(boolean withDefaults)
Creates a new
Model instance using default values or not. |
String |
toString() |
Model.Builder |
with()
Creates a new builder with this object as the basis.
|
Model |
withArtifactId(String artifactId)
Creates a new
Model instance using the specified artifactId. |
Model |
withBuild(Build build)
Creates a new
Model instance using the specified build. |
Model |
withChildProjectUrlInheritAppendPath(String childProjectUrlInheritAppendPath)
Creates a new
Model instance using the specified childProjectUrlInheritAppendPath. |
Model |
withCiManagement(CiManagement ciManagement)
Creates a new
Model instance using the specified ciManagement. |
Model |
withContributors(Collection<Contributor> contributors)
Creates a new
Model instance using the specified contributors. |
Model |
withDependencies(Collection<Dependency> dependencies)
Creates a new
Model instance using the specified dependencies. |
Model |
withDependencyManagement(DependencyManagement dependencyManagement)
Creates a new
Model instance using the specified dependencyManagement. |
Model |
withDescription(String description)
Creates a new
Model instance using the specified description. |
Model |
withDevelopers(Collection<Developer> developers)
Creates a new
Model instance using the specified developers. |
Model |
withDistributionManagement(DistributionManagement distributionManagement)
Creates a new
Model instance using the specified distributionManagement. |
Model |
withGroupId(String groupId)
Creates a new
Model instance using the specified groupId. |
Model |
withInceptionYear(String inceptionYear)
Creates a new
Model instance using the specified inceptionYear. |
Model |
withIssueManagement(IssueManagement issueManagement)
Creates a new
Model instance using the specified issueManagement. |
Model |
withLicenses(Collection<License> licenses)
Creates a new
Model instance using the specified licenses. |
Model |
withMailingLists(Collection<MailingList> mailingLists)
Creates a new
Model instance using the specified mailingLists. |
Model |
withModelVersion(String modelVersion)
Creates a new
Model instance using the specified modelVersion. |
Model |
withModules(Collection<String> modules)
Creates a new
Model instance using the specified modules. |
Model |
withName(String name)
Creates a new
Model instance using the specified name. |
Model |
withOrganization(Organization organization)
Creates a new
Model instance using the specified organization. |
Model |
withPackaging(String packaging)
Creates a new
Model instance using the specified packaging. |
Model |
withParent(Parent parent)
Creates a new
Model instance using the specified parent. |
Model |
withPluginRepositories(Collection<Repository> pluginRepositories)
Creates a new
Model instance using the specified pluginRepositories. |
Model |
withPomFile(Path pomFile)
Creates a new
Model instance using the specified pomFile. |
Model |
withPrerequisites(Prerequisites prerequisites)
Creates a new
Model instance using the specified prerequisites. |
Model |
withProfiles(Collection<Profile> profiles)
Creates a new
Model instance using the specified profiles. |
Model |
withProperties(Map<String,String> properties)
Creates a new
Model instance using the specified properties. |
Model |
withReporting(Reporting reporting)
Creates a new
Model instance using the specified reporting. |
Model |
withRepositories(Collection<Repository> repositories)
Creates a new
Model instance using the specified repositories. |
Model |
withScm(Scm scm)
Creates a new
Model instance using the specified scm. |
Model |
withUrl(String url)
Creates a new
Model instance using the specified url. |
Model |
withVersion(String version)
Creates a new
Model instance using the specified version. |
getDependencies, getDependencyManagement, getDistributionManagement, getModules, getPluginRepositories, getProperties, getReporting, getRepositories, newBuilder, newBuilder
public String getModelEncoding()
public Path getPomFile()
Path
public String getModelVersion()
String
public Parent getParent()
Parent
public String getGroupId()
org.apache.maven
).String
public String getArtifactId()
String
public String getVersion()
String
public String getPackaging()
jar
war
ear
pom
.
Plugins can create their own packaging, and
therefore their own packaging types,
so this list does not contain all possible types.String
public String getName()
String
public String getDescription()
String
public String getUrl()
child.project.url.inherit.append.path="false"
String
public String getChildProjectUrlInheritAppendPath()
String
for technical reasons, the semantic type is actually
Boolean
true
String
public String getInceptionYear()
String
public Organization getOrganization()
Organization
@Nonnull public List<License> getLicenses()
license
element, 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.List<License>
@Nonnull public List<Developer> getDevelopers()
List<Developer>
@Nonnull public List<Contributor> getContributors()
List<Contributor>
@Nonnull public List<MailingList> getMailingLists()
List<MailingList>
public Prerequisites getPrerequisites()
Prerequisites
public Scm getScm()
Scm
public IssueManagement getIssueManagement()
IssueManagement
public CiManagement getCiManagement()
CiManagement
public Build getBuild()
Build
@Nonnull public List<Profile> getProfiles()
List<Profile>
public InputLocation getLocation(Object key)
getLocation
in interface InputLocationTracker
getLocation
in class ModelBase
@Nonnull public Model.Builder with()
@Nonnull public Model withModules(Collection<String> modules)
Model
instance using the specified modules.withModules
in class ModelBase
modules
- the new Collection<String>
to useModel
with the specified modules@Nonnull public Model withDistributionManagement(DistributionManagement distributionManagement)
Model
instance using the specified distributionManagement.withDistributionManagement
in class ModelBase
distributionManagement
- the new DistributionManagement
to useModel
with the specified distributionManagement@Nonnull public Model withProperties(Map<String,String> properties)
Model
instance using the specified properties.withProperties
in class ModelBase
properties
- the new Map<String, String>
to useModel
with the specified properties@Nonnull public Model withDependencyManagement(DependencyManagement dependencyManagement)
Model
instance using the specified dependencyManagement.withDependencyManagement
in class ModelBase
dependencyManagement
- the new DependencyManagement
to useModel
with the specified dependencyManagement@Nonnull public Model withDependencies(Collection<Dependency> dependencies)
Model
instance using the specified dependencies.withDependencies
in class ModelBase
dependencies
- the new Collection<Dependency>
to useModel
with the specified dependencies@Nonnull public Model withRepositories(Collection<Repository> repositories)
Model
instance using the specified repositories.withRepositories
in class ModelBase
repositories
- the new Collection<Repository>
to useModel
with the specified repositories@Nonnull public Model withPluginRepositories(Collection<Repository> pluginRepositories)
Model
instance using the specified pluginRepositories.withPluginRepositories
in class ModelBase
pluginRepositories
- the new Collection<Repository>
to useModel
with the specified pluginRepositories@Nonnull public Model withReporting(Reporting reporting)
Model
instance using the specified reporting.withReporting
in class ModelBase
reporting
- the new Reporting
to useModel
with the specified reporting@Nonnull public Model withPomFile(Path pomFile)
Model
instance using the specified pomFile.pomFile
- the new Path
to useModel
with the specified pomFile@Nonnull public Model withModelVersion(String modelVersion)
Model
instance using the specified modelVersion.modelVersion
- the new String
to useModel
with the specified modelVersion@Nonnull public Model withParent(Parent parent)
Model
instance using the specified parent.parent
- the new Parent
to useModel
with the specified parent@Nonnull public Model withGroupId(String groupId)
Model
instance using the specified groupId.groupId
- the new String
to useModel
with the specified groupId@Nonnull public Model withArtifactId(String artifactId)
Model
instance using the specified artifactId.artifactId
- the new String
to useModel
with the specified artifactId@Nonnull public Model withVersion(String version)
Model
instance using the specified version.version
- the new String
to useModel
with the specified version@Nonnull public Model withPackaging(String packaging)
Model
instance using the specified packaging.packaging
- the new String
to useModel
with the specified packaging@Nonnull public Model withName(String name)
Model
instance using the specified name.name
- the new String
to useModel
with the specified name@Nonnull public Model withDescription(String description)
Model
instance using the specified description.description
- the new String
to useModel
with the specified description@Nonnull public Model withUrl(String url)
Model
instance using the specified url.url
- the new String
to useModel
with the specified url@Nonnull public Model withChildProjectUrlInheritAppendPath(String childProjectUrlInheritAppendPath)
Model
instance using the specified childProjectUrlInheritAppendPath.childProjectUrlInheritAppendPath
- the new String
to useModel
with the specified childProjectUrlInheritAppendPath@Nonnull public Model withInceptionYear(String inceptionYear)
Model
instance using the specified inceptionYear.inceptionYear
- the new String
to useModel
with the specified inceptionYear@Nonnull public Model withOrganization(Organization organization)
Model
instance using the specified organization.organization
- the new Organization
to useModel
with the specified organization@Nonnull public Model withLicenses(Collection<License> licenses)
Model
instance using the specified licenses.licenses
- the new Collection<License>
to useModel
with the specified licenses@Nonnull public Model withDevelopers(Collection<Developer> developers)
Model
instance using the specified developers.developers
- the new Collection<Developer>
to useModel
with the specified developers@Nonnull public Model withContributors(Collection<Contributor> contributors)
Model
instance using the specified contributors.contributors
- the new Collection<Contributor>
to useModel
with the specified contributors@Nonnull public Model withMailingLists(Collection<MailingList> mailingLists)
Model
instance using the specified mailingLists.mailingLists
- the new Collection<MailingList>
to useModel
with the specified mailingLists@Nonnull public Model withPrerequisites(Prerequisites prerequisites)
Model
instance using the specified prerequisites.prerequisites
- the new Prerequisites
to useModel
with the specified prerequisites@Nonnull public Model withScm(Scm scm)
Model
instance using the specified scm.scm
- the new Scm
to useModel
with the specified scm@Nonnull public Model withIssueManagement(IssueManagement issueManagement)
Model
instance using the specified issueManagement.issueManagement
- the new IssueManagement
to useModel
with the specified issueManagement@Nonnull public Model withCiManagement(CiManagement ciManagement)
Model
instance using the specified ciManagement.ciManagement
- the new CiManagement
to useModel
with the specified ciManagement@Nonnull public Model withBuild(Build build)
Model
instance using the specified build.build
- the new Build
to useModel
with the specified build@Nonnull public Model withProfiles(Collection<Profile> profiles)
Model
instance using the specified profiles.profiles
- the new Collection<Profile>
to useModel
with the specified profiles@Nonnull public static Model newInstance()
Model
instance.
Equivalent to newInstance( true )
.Model
newInstance(boolean)
@Nonnull public static Model newInstance(boolean withDefaults)
Model
instance using default values or not.
Equivalent to newBuilder( withDefaults ).build()
.withDefaults
- the boolean indicating whether default values should be usedModel
@Nonnull public static Model.Builder newBuilder()
Model
builder instance.
Equivalent to newBuilder( true )
.Builder
newBuilder(boolean)
@Nonnull public static Model.Builder newBuilder(boolean withDefaults)
Model
builder instance using default values or not.withDefaults
- the boolean indicating whether default values should be usedBuilder
@Nonnull public static Model.Builder newBuilder(Model from)
Model
builder instance using the specified object as a basis.
Equivalent to newBuilder( from, false )
.from
- the Model
instance to use as a basisBuilder
@Nonnull public static Model.Builder newBuilder(Model from, boolean forceCopy)
Model
builder instance using the specified object as a basis.from
- the Model
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forcedBuilder
public Path getProjectDirectory()
null
if this model does not belong to a local
project (e.g. describes the metadata of some artifact from the repository).public String getId()
groupId:artifactId:packaging:version
public boolean isChildProjectUrlInheritAppendPath()
Copyright © 2001–2022 The Apache Software Foundation. All rights reserved.