Package org.apache.maven.api.model
Class ModelBase
java.lang.Object
org.apache.maven.api.model.ModelBase
- All Implemented Interfaces:
Serializable
,InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class ModelBase
extends Object
implements Serializable, InputLocationTracker
Base class for the
Model
and the Profile
objects.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create ModelBase instances. -
Constructor Summary
ModifierConstructorDescriptionprotected
ModelBase
(ModelBase.Builder builder) Constructor for this class, to be called from its subclasses andModelBase.Builder
. -
Method Summary
Modifier and TypeMethodDescriptionThis element describes all the dependencies associated with a project.Default dependency information for projects that inherit from this one.Distribution information for a project that enables deployment of the site and artifacts to remote web servers and repositories respectively.Gets the input location that caused this model to be read.getLocation
(Object key) Gets the location of the specified field in the input source.Gets the keys of the locations of the input source.Deprecated.The lists of the remote repositories for discovering plugins for builds and reports.Properties that can be used throughout the POM as a substitution, and are used as filters in resources if enabled.This element includes the specification of report plugins to use to generate the reports on the Maven-generated site.The lists of the remote repositories for discovering dependencies and extensions.The subprojects (formerly called modules) to build as a part of this project.static ModelBase.Builder
Creates a newModelBase
builder instance.static ModelBase.Builder
newBuilder
(boolean withDefaults) Creates a newModelBase
builder instance using default values or not.static ModelBase.Builder
newBuilder
(ModelBase from) Creates a newModelBase
builder instance using the specified object as a basis.static ModelBase.Builder
newBuilder
(ModelBase from, boolean forceCopy) Creates a newModelBase
builder instance using the specified object as a basis.static ModelBase
Creates a newModelBase
instance.static ModelBase
newInstance
(boolean withDefaults) Creates a newModelBase
instance using default values or not.with()
Creates a new builder with this object as the basis.withDependencies
(Collection<Dependency> dependencies) Creates a newModelBase
instance using the specified dependencies.withDependencyManagement
(DependencyManagement dependencyManagement) Creates a newModelBase
instance using the specified dependencyManagement.withDistributionManagement
(DistributionManagement distributionManagement) Creates a newModelBase
instance using the specified distributionManagement.withModules
(Collection<String> modules) Deprecated.withPluginRepositories
(Collection<Repository> pluginRepositories) Creates a newModelBase
instance using the specified pluginRepositories.withProperties
(Map<String, String> properties) Creates a newModelBase
instance using the specified properties.withReporting
(Reporting reporting) Creates a newModelBase
instance using the specified reporting.withRepositories
(Collection<Repository> repositories) Creates a newModelBase
instance using the specified repositories.withSubprojects
(Collection<String> subprojects) Creates a newModelBase
instance using the specified subprojects.
-
Constructor Details
-
ModelBase
Constructor for this class, to be called from its subclasses andModelBase.Builder
.- See Also:
-
-
Method Details
-
getModules
Deprecated.Usesubprojects
instead.- Returns:
- a
List<String>
-
getSubprojects
The subprojects (formerly called modules) to build as a part of this project. Each subproject listed is a relative path to the directory containing the subproject. To be consistent with the way default URLs are calculated from parent, it is recommended to have subproject names match artifact ids.- Returns:
- a
List<String>
-
getDistributionManagement
Distribution information for a project that enables deployment of the site and artifacts to remote web servers and repositories respectively.- Returns:
- a
DistributionManagement
-
getProperties
Properties that can be used throughout the POM as a substitution, and are used as filters in resources if enabled. The format is<name>value</name>
.- Returns:
- a
Map<String, String>
-
getDependencyManagement
Default dependency information for projects that inherit from this one. The dependencies in this section are not immediately resolved. Instead, when a POM derived from this one declares a dependency described by a matching groupId and artifactId, the version and other values from this section are used for that dependency if they were not already specified.- Returns:
- a
DependencyManagement
-
getDependencies
This element describes all the dependencies associated with a project. These dependencies are used to construct a classpath for your project during the build process. They are automatically downloaded from the repositories defined in this project.- Returns:
- a
List<Dependency>
- See Also:
-
getRepositories
The lists of the remote repositories for discovering dependencies and extensions.- Returns:
- a
List<Repository>
-
getPluginRepositories
The lists of the remote repositories for discovering plugins for builds and reports.- Returns:
- a
List<Repository>
-
getReporting
This element includes the specification of report plugins to use to generate the reports on the Maven-generated site. These reports will be run when a user executesmvn site
. All the reports will be included in the navigation bar for browsing.- Returns:
- a
Reporting
-
getLocation
Gets the location of the specified field in the input source.- Specified by:
getLocation
in interfaceInputLocationTracker
-
getLocationKeys
Gets the keys of the locations of the input source. -
getImportedFrom
Gets the input location that caused this model to be read.- Specified by:
getImportedFrom
in interfaceInputLocationTracker
- Returns:
- InputLocation
-
with
Creates a new builder with this object as the basis.- Returns:
- a
Builder
-
withModules
Deprecated.Creates a newModelBase
instance using the specified modules.- Parameters:
modules
- the newCollection<String>
to use- Returns:
- a
ModelBase
with the specified modules
-
withSubprojects
Creates a newModelBase
instance using the specified subprojects.- Parameters:
subprojects
- the newCollection<String>
to use- Returns:
- a
ModelBase
with the specified subprojects
-
withDistributionManagement
Creates a newModelBase
instance using the specified distributionManagement.- Parameters:
distributionManagement
- the newDistributionManagement
to use- Returns:
- a
ModelBase
with the specified distributionManagement
-
withProperties
Creates a newModelBase
instance using the specified properties.- Parameters:
properties
- the newMap<String, String>
to use- Returns:
- a
ModelBase
with the specified properties
-
withDependencyManagement
Creates a newModelBase
instance using the specified dependencyManagement.- Parameters:
dependencyManagement
- the newDependencyManagement
to use- Returns:
- a
ModelBase
with the specified dependencyManagement
-
withDependencies
Creates a newModelBase
instance using the specified dependencies.- Parameters:
dependencies
- the newCollection<Dependency>
to use- Returns:
- a
ModelBase
with the specified dependencies
-
withRepositories
Creates a newModelBase
instance using the specified repositories.- Parameters:
repositories
- the newCollection<Repository>
to use- Returns:
- a
ModelBase
with the specified repositories
-
withPluginRepositories
Creates a newModelBase
instance using the specified pluginRepositories.- Parameters:
pluginRepositories
- the newCollection<Repository>
to use- Returns:
- a
ModelBase
with the specified pluginRepositories
-
withReporting
Creates a newModelBase
instance using the specified reporting.- Parameters:
reporting
- the newReporting
to use- Returns:
- a
ModelBase
with the specified reporting
-
newInstance
Creates a newModelBase
instance. Equivalent tonewInstance(true)
.- Returns:
- a new
ModelBase
- See Also:
-
newInstance
Creates a newModelBase
instance using default values or not. Equivalent tonewBuilder(withDefaults).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
ModelBase
-
newBuilder
Creates a newModelBase
builder instance. Equivalent tonewBuilder(true)
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newModelBase
builder instance using default values or not.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newModelBase
builder instance using the specified object as a basis. Equivalent tonewBuilder(from, false)
.- Parameters:
from
- theModelBase
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newModelBase
builder instance using the specified object as a basis.- Parameters:
from
- theModelBase
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
subprojects
instead.