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
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create ModelBase instances. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedModelBase(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.BuilderCreates a newModelBasebuilder instance.static ModelBase.BuildernewBuilder(boolean withDefaults) Creates a newModelBasebuilder instance using default values or not.static ModelBase.BuildernewBuilder(ModelBase from) Creates a newModelBasebuilder instance using the specified object as a basis.static ModelBase.BuildernewBuilder(ModelBase from, boolean forceCopy) Creates a newModelBasebuilder instance using the specified object as a basis.static ModelBaseCreates a newModelBaseinstance.static ModelBasenewInstance(boolean withDefaults) Creates a newModelBaseinstance using default values or not.with()Creates a new builder with this object as the basis.withDependencies(Collection<Dependency> dependencies) Creates a newModelBaseinstance using the specified dependencies.withDependencyManagement(DependencyManagement dependencyManagement) Creates a newModelBaseinstance using the specified dependencyManagement.withDistributionManagement(DistributionManagement distributionManagement) Creates a newModelBaseinstance using the specified distributionManagement.withModules(Collection<String> modules) Deprecated.withPluginRepositories(Collection<Repository> pluginRepositories) Creates a newModelBaseinstance using the specified pluginRepositories.withProperties(Map<String, String> properties) Creates a newModelBaseinstance using the specified properties.withReporting(Reporting reporting) Creates a newModelBaseinstance using the specified reporting.withRepositories(Collection<Repository> repositories) Creates a newModelBaseinstance using the specified repositories.withSubprojects(Collection<String> subprojects) Creates a newModelBaseinstance 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.Usesubprojectsinstead.- 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:
getLocationin interfaceInputLocationTracker
-
getLocationKeys
Gets the keys of the locations of the input source. -
getLocationKeyStream
-
getImportedFrom
Gets the input location that caused this model to be read.- Specified by:
getImportedFromin interfaceInputLocationTracker- Returns:
- InputLocation
-
with
Creates a new builder with this object as the basis.- Returns:
- a
Builder
-
withModules
Deprecated.Creates a newModelBaseinstance using the specified modules.- Parameters:
modules- the newCollection<String>to use- Returns:
- a
ModelBasewith the specified modules
-
withSubprojects
Creates a newModelBaseinstance using the specified subprojects.- Parameters:
subprojects- the newCollection<String>to use- Returns:
- a
ModelBasewith the specified subprojects
-
withDistributionManagement
Creates a newModelBaseinstance using the specified distributionManagement.- Parameters:
distributionManagement- the newDistributionManagementto use- Returns:
- a
ModelBasewith the specified distributionManagement
-
withProperties
Creates a newModelBaseinstance using the specified properties.- Parameters:
properties- the newMap<String, String>to use- Returns:
- a
ModelBasewith the specified properties
-
withDependencyManagement
Creates a newModelBaseinstance using the specified dependencyManagement.- Parameters:
dependencyManagement- the newDependencyManagementto use- Returns:
- a
ModelBasewith the specified dependencyManagement
-
withDependencies
Creates a newModelBaseinstance using the specified dependencies.- Parameters:
dependencies- the newCollection<Dependency>to use- Returns:
- a
ModelBasewith the specified dependencies
-
withRepositories
Creates a newModelBaseinstance using the specified repositories.- Parameters:
repositories- the newCollection<Repository>to use- Returns:
- a
ModelBasewith the specified repositories
-
withPluginRepositories
Creates a newModelBaseinstance using the specified pluginRepositories.- Parameters:
pluginRepositories- the newCollection<Repository>to use- Returns:
- a
ModelBasewith the specified pluginRepositories
-
withReporting
Creates a newModelBaseinstance using the specified reporting.- Parameters:
reporting- the newReportingto use- Returns:
- a
ModelBasewith the specified reporting
-
newInstance
Creates a newModelBaseinstance. Equivalent tonewInstance(true).- Returns:
- a new
ModelBase - See Also:
-
newInstance
Creates a newModelBaseinstance 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 newModelBasebuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new
Builder - See Also:
-
newBuilder
Creates a newModelBasebuilder instance using default values or not.- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newModelBasebuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
from- theModelBaseinstance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newModelBasebuilder instance using the specified object as a basis.- Parameters:
from- theModelBaseinstance to use as a basisforceCopy- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
subprojectsinstead.