Class Build
java.lang.Object
org.apache.maven.api.model.PluginContainer
org.apache.maven.api.model.PluginConfiguration
org.apache.maven.api.model.BuildBase
org.apache.maven.api.model.Build
- All Implemented Interfaces:
Serializable,InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class Build
extends BuildBase
implements Serializable, InputLocationTracker
The
<build> element contains information required to build the project.
Default values are defined in Super POM.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create Build instances. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuild(Build.Builder builder) Constructor for this class, to be called from its subclasses andBuild.Builder. -
Method Summary
Modifier and TypeMethodDescriptionA set of build extensions to use from this project.The directory where compiled application classes are placed.Deprecated.Deprecated.Replaced by<Source>withmainscope.All the sources to compile and resources files to copy for a project or it's unit tests.The directory where compiled test classes are placed.Deprecated.Replaced by<Source>withtestscope.static Build.BuilderCreates a newBuildbuilder instance.static Build.BuildernewBuilder(boolean withDefaults) Creates a newBuildbuilder instance using default values or not.static Build.BuildernewBuilder(Build from) Creates a newBuildbuilder instance using the specified object as a basis.static Build.BuildernewBuilder(Build from, boolean forceCopy) Creates a newBuildbuilder instance using the specified object as a basis.static BuildCreates a newBuildinstance.static BuildnewInstance(boolean withDefaults) Creates a newBuildinstance using default values or not.toString()with()Creates a new builder with this object as the basis.withDefaultGoal(String defaultGoal) Creates a newBuildinstance using the specified defaultGoal.withDirectory(String directory) Creates a newBuildinstance using the specified directory.withExtensions(Collection<Extension> extensions) Creates a newBuildinstance using the specified extensions.withFilters(Collection<String> filters) Creates a newBuildinstance using the specified filters.withFinalName(String finalName) Creates a newBuildinstance using the specified finalName.withOutputDirectory(String outputDirectory) Creates a newBuildinstance using the specified outputDirectory.withPluginManagement(PluginManagement pluginManagement) Creates a newBuildinstance using the specified pluginManagement.withPlugins(Collection<Plugin> plugins) Creates a newBuildinstance using the specified plugins.withResources(Collection<Resource> resources) Deprecated.withScriptSourceDirectory(String scriptSourceDirectory) Deprecated.withSourceDirectory(String sourceDirectory) Deprecated.withSources(Collection<Source> sources) Creates a newBuildinstance using the specified sources.withTestOutputDirectory(String testOutputDirectory) Creates a newBuildinstance using the specified testOutputDirectory.withTestResources(Collection<Resource> testResources) Deprecated.withTestSourceDirectory(String testSourceDirectory) Deprecated.Methods inherited from class org.apache.maven.api.model.BuildBase
getDefaultGoal, getDirectory, getFilters, getFinalName, getResources, getTestResources, newBuilder, newBuilderMethods inherited from class org.apache.maven.api.model.PluginConfiguration
getPluginManagement, newBuilder, newBuilderMethods inherited from class org.apache.maven.api.model.PluginContainer
getImportedFrom, getLocation, getLocationKeys, getLocationKeyStream, getPlugins, getPluginsAsMap, newBuilder, newBuilderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.maven.api.model.InputLocationTracker
getImportedFrom, getLocation
-
Constructor Details
-
Build
Constructor for this class, to be called from its subclasses andBuild.Builder.- See Also:
-
-
Method Details
-
getSources
All the sources to compile and resources files to copy for a project or it's unit tests. The sources can be Java source files, generated source files, scripts, or resources for examples. Each source is specified by adirectoryelement, which is relative to the POM. The kind of sources (source files to compile or resources to copy) and their usage (for the main code or for the tests) is specified by thescopeelement together with each source directory.- Returns:
- a
List<Source>
-
getSourceDirectory
Deprecated.Replaced by<Source>withmainscope.This element specifies a directory containing the source of the project. The generated build system will compile the sources from this directory when the project is built. The path given is relative to the project descriptor. The default value issrc/main/java.- Returns:
- a
String
-
getScriptSourceDirectory
Deprecated.Replaced by<Source>withscriptlanguage.This element specifies a directory containing the script sources of the project. This directory is meant to be different from the sourceDirectory, in that its contents will be copied to the output directory in most cases (since scripts are interpreted rather than compiled). The default value issrc/main/scripts.- Returns:
- a
String
-
getTestSourceDirectory
Deprecated.Replaced by<Source>withtestscope.This element specifies a directory containing the unit test source of the project. The generated build system will compile these directories when the project is being tested. The path given is relative to the project descriptor. The default value issrc/test/java.- Returns:
- a
String
-
getOutputDirectory
The directory where compiled application classes are placed. The default value istarget/classes.- Returns:
- a
String
-
getTestOutputDirectory
The directory where compiled test classes are placed. The default value istarget/test-classes.- Returns:
- a
String
-
getExtensions
-
with
Creates a new builder with this object as the basis. -
withPlugins
Creates a newBuildinstance using the specified plugins.- Overrides:
withPluginsin classBuildBase- Parameters:
plugins- the newCollection<Plugin>to use- Returns:
- a
Buildwith the specified plugins
-
withPluginManagement
Creates a newBuildinstance using the specified pluginManagement.- Overrides:
withPluginManagementin classBuildBase- Parameters:
pluginManagement- the newPluginManagementto use- Returns:
- a
Buildwith the specified pluginManagement
-
withDefaultGoal
Creates a newBuildinstance using the specified defaultGoal.- Overrides:
withDefaultGoalin classBuildBase- Parameters:
defaultGoal- the newStringto use- Returns:
- a
Buildwith the specified defaultGoal
-
withResources
Deprecated.Creates a newBuildinstance using the specified resources.- Overrides:
withResourcesin classBuildBase- Parameters:
resources- the newCollection<Resource>to use- Returns:
- a
Buildwith the specified resources
-
withTestResources
@Deprecated(since="4.0.0") @Nonnull public Build withTestResources(Collection<Resource> testResources) Deprecated.Creates a newBuildinstance using the specified testResources.- Overrides:
withTestResourcesin classBuildBase- Parameters:
testResources- the newCollection<Resource>to use- Returns:
- a
Buildwith the specified testResources
-
withDirectory
Creates a newBuildinstance using the specified directory.- Overrides:
withDirectoryin classBuildBase- Parameters:
directory- the newStringto use- Returns:
- a
Buildwith the specified directory
-
withFinalName
Creates a newBuildinstance using the specified finalName.- Overrides:
withFinalNamein classBuildBase- Parameters:
finalName- the newStringto use- Returns:
- a
Buildwith the specified finalName
-
withFilters
Creates a newBuildinstance using the specified filters.- Overrides:
withFiltersin classBuildBase- Parameters:
filters- the newCollection<String>to use- Returns:
- a
Buildwith the specified filters
-
withSources
Creates a newBuildinstance using the specified sources.- Parameters:
sources- the newCollection<Source>to use- Returns:
- a
Buildwith the specified sources
-
withSourceDirectory
Deprecated.Creates a newBuildinstance using the specified sourceDirectory.- Parameters:
sourceDirectory- the newStringto use- Returns:
- a
Buildwith the specified sourceDirectory
-
withScriptSourceDirectory
@Deprecated(since="4.0.0") @Nonnull public Build withScriptSourceDirectory(String scriptSourceDirectory) Deprecated.Creates a newBuildinstance using the specified scriptSourceDirectory.- Parameters:
scriptSourceDirectory- the newStringto use- Returns:
- a
Buildwith the specified scriptSourceDirectory
-
withTestSourceDirectory
@Deprecated(since="4.0.0") @Nonnull public Build withTestSourceDirectory(String testSourceDirectory) Deprecated.Creates a newBuildinstance using the specified testSourceDirectory.- Parameters:
testSourceDirectory- the newStringto use- Returns:
- a
Buildwith the specified testSourceDirectory
-
withOutputDirectory
-
withTestOutputDirectory
-
withExtensions
Creates a newBuildinstance using the specified extensions.- Parameters:
extensions- the newCollection<Extension>to use- Returns:
- a
Buildwith the specified extensions
-
newInstance
-
newInstance
-
newBuilder
Creates a newBuildbuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new
Builder - See Also:
-
newBuilder
Creates a newBuildbuilder instance using default values or not.- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newBuildbuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
from- theBuildinstance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newBuildbuilder instance using the specified object as a basis.- Parameters:
from- theBuildinstance to use as a basisforceCopy- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
toString
-
<Source>withscriptlanguage.