Class ModelBase

java.lang.Object
org.apache.maven.api.model.ModelBase
All Implemented Interfaces:
Serializable, InputLocationTracker
Direct Known Subclasses:
Model, Profile

@Experimental @Generated @ThreadSafe @Immutable public class ModelBase extends Object implements Serializable, InputLocationTracker
Base class for the Model and the Profile objects.
See Also:
  • Method Details

    • getModules

      @Nonnull public List<String> getModules()
      The modules (sometimes called subprojects) to build as a part of this project. Each module listed is a relative path to the directory containing the module. To be consistent with the way default urls are calculated from parent, it is recommended to have module names match artifact ids.
      Returns:
      a List<String>
    • getDistributionManagement

      public DistributionManagement 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

      @Nonnull public Map<String,String> 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

      public DependencyManagement 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

      @Nonnull public List<Dependency> getDependencies()
      This element describes all of 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. See the dependency mechanism for more information.
      Returns:
      a List<Dependency>
    • getRepositories

      @Nonnull public List<Repository> getRepositories()
      The lists of the remote repositories for discovering dependencies and extensions.
      Returns:
      a List<Repository>
    • getPluginRepositories

      @Nonnull public List<Repository> getPluginRepositories()
      The lists of the remote repositories for discovering plugins for builds and reports.
      Returns:
      a List<Repository>
    • getReporting

      public Reporting 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 executes mvn site. All of the reports will be included in the navigation bar for browsing.
      Returns:
      a Reporting
    • getLocation

      public InputLocation getLocation(Object key)
      Gets the location of the specified field in the input source.
      Specified by:
      getLocation in interface InputLocationTracker
    • with

      @Nonnull public ModelBase.Builder with()
      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withModules

      @Nonnull public ModelBase withModules(Collection<String> modules)
      Creates a new ModelBase instance using the specified modules.
      Parameters:
      modules - the new Collection<String> to use
      Returns:
      a ModelBase with the specified modules
    • withDistributionManagement

      @Nonnull public ModelBase withDistributionManagement(DistributionManagement distributionManagement)
      Creates a new ModelBase instance using the specified distributionManagement.
      Parameters:
      distributionManagement - the new DistributionManagement to use
      Returns:
      a ModelBase with the specified distributionManagement
    • withProperties

      @Nonnull public ModelBase withProperties(Map<String,String> properties)
      Creates a new ModelBase instance using the specified properties.
      Parameters:
      properties - the new Map<String, String> to use
      Returns:
      a ModelBase with the specified properties
    • withDependencyManagement

      @Nonnull public ModelBase withDependencyManagement(DependencyManagement dependencyManagement)
      Creates a new ModelBase instance using the specified dependencyManagement.
      Parameters:
      dependencyManagement - the new DependencyManagement to use
      Returns:
      a ModelBase with the specified dependencyManagement
    • withDependencies

      @Nonnull public ModelBase withDependencies(Collection<Dependency> dependencies)
      Creates a new ModelBase instance using the specified dependencies.
      Parameters:
      dependencies - the new Collection<Dependency> to use
      Returns:
      a ModelBase with the specified dependencies
    • withRepositories

      @Nonnull public ModelBase withRepositories(Collection<Repository> repositories)
      Creates a new ModelBase instance using the specified repositories.
      Parameters:
      repositories - the new Collection<Repository> to use
      Returns:
      a ModelBase with the specified repositories
    • withPluginRepositories

      @Nonnull public ModelBase withPluginRepositories(Collection<Repository> pluginRepositories)
      Creates a new ModelBase instance using the specified pluginRepositories.
      Parameters:
      pluginRepositories - the new Collection<Repository> to use
      Returns:
      a ModelBase with the specified pluginRepositories
    • withReporting

      @Nonnull public ModelBase withReporting(Reporting reporting)
      Creates a new ModelBase instance using the specified reporting.
      Parameters:
      reporting - the new Reporting to use
      Returns:
      a ModelBase with the specified reporting
    • newInstance

      @Nonnull public static ModelBase newInstance()
      Creates a new ModelBase instance. Equivalent to newInstance( true ).
      Returns:
      a new ModelBase
      See Also:
    • newInstance

      @Nonnull public static ModelBase newInstance(boolean withDefaults)
      Creates a new ModelBase instance using default values or not. Equivalent to newBuilder( withDefaults ).build().
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new ModelBase
    • newBuilder

      @Nonnull public static ModelBase.Builder newBuilder()
      Creates a new ModelBase builder instance. Equivalent to newBuilder( true ).
      Returns:
      a new Builder
      See Also:
    • newBuilder

      @Nonnull public static ModelBase.Builder newBuilder(boolean withDefaults)
      Creates a new ModelBase builder instance using default values or not.
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static ModelBase.Builder newBuilder(ModelBase from)
      Creates a new ModelBase builder instance using the specified object as a basis. Equivalent to newBuilder( from, false ).
      Parameters:
      from - the ModelBase instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static ModelBase.Builder newBuilder(ModelBase from, boolean forceCopy)
      Creates a new ModelBase builder instance using the specified object as a basis.
      Parameters:
      from - the ModelBase instance to use as a basis
      forceCopy - the boolean indicating if a copy should be forced
      Returns:
      a new Builder