Package org.apache.maven.api.model
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 informations 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. -
Method Summary
Modifier and TypeMethodDescriptionA set of build extensions to use from this project.The directory where compiled application classes are placed.This element specifies a directory containing the script sources of the project.This element specifies a directory containing the source of the project.The directory where compiled test classes are placed.This element specifies a directory containing the unit test source of the project.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) Creates a newBuildinstance using the specified resources.withScriptSourceDirectory(String scriptSourceDirectory) Creates a newBuildinstance using the specified scriptSourceDirectory.withSourceDirectory(String sourceDirectory) Creates a newBuildinstance using the specified sourceDirectory.withTestOutputDirectory(String testOutputDirectory) Creates a newBuildinstance using the specified testOutputDirectory.withTestResources(Collection<Resource> testResources) Creates a newBuildinstance using the specified testResources.withTestSourceDirectory(String testSourceDirectory) Creates a newBuildinstance using the specified testSourceDirectory.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
getLocation, 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
getLocation
-
Method Details
-
getSourceDirectory
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
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
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
A set of build extensions to use from this project.- Returns:
- a
List<Extension>
-
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
Creates a newBuildinstance using the specified resources.- Overrides:
withResourcesin classBuildBase- Parameters:
resources- the newCollection<Resource>to use- Returns:
- a
Buildwith the specified resources
-
withTestResources
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
-
withSourceDirectory
Creates a newBuildinstance using the specified sourceDirectory.- Parameters:
sourceDirectory- the newStringto use- Returns:
- a
Buildwith the specified sourceDirectory
-
withScriptSourceDirectory
Creates a newBuildinstance using the specified scriptSourceDirectory.- Parameters:
scriptSourceDirectory- the newStringto use- Returns:
- a
Buildwith the specified scriptSourceDirectory
-
withTestSourceDirectory
Creates a newBuildinstance using the specified testSourceDirectory.- Parameters:
testSourceDirectory- the newStringto use- Returns:
- a
Buildwith the specified testSourceDirectory
-
withOutputDirectory
Creates a newBuildinstance using the specified outputDirectory.- Parameters:
outputDirectory- the newStringto use- Returns:
- a
Buildwith the specified outputDirectory
-
withTestOutputDirectory
Creates a newBuildinstance using the specified testOutputDirectory.- Parameters:
testOutputDirectory- the newStringto use- Returns:
- a
Buildwith the specified testOutputDirectory
-
withExtensions
Creates a newBuildinstance using the specified extensions.- Parameters:
extensions- the newCollection<Extension>to use- Returns:
- a
Buildwith the specified extensions
-
newInstance
Creates a newBuildinstance. Equivalent tonewInstance(true).- Returns:
- a new
Build - See Also:
-
newInstance
Creates a newBuildinstance using default values or not. Equivalent tonewBuilder(withDefaults).build().- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
Build
-
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
-