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
Modifier and TypeClassDescriptionstatic class
Builder class used to create Build instances. -
Method Summary
Modifier and TypeMethodDescriptionA set of build extensions to use from this project.getLocation
(Object key) Gets the location of the specified field in the input source.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.Builder
Creates a newBuild
builder instance.static Build.Builder
newBuilder
(boolean withDefaults) Creates a newBuild
builder instance using default values or not.static Build.Builder
newBuilder
(Build from) Creates a newBuild
builder instance using the specified object as a basis.static Build.Builder
newBuilder
(Build from, boolean forceCopy) Creates a newBuild
builder instance using the specified object as a basis.static Build
Creates a newBuild
instance.static Build
newInstance
(boolean withDefaults) Creates a newBuild
instance using default values or not.with()
Creates a new builder with this object as the basis.withDefaultGoal
(String defaultGoal) Creates a newBuild
instance using the specified defaultGoal.withDirectory
(String directory) Creates a newBuild
instance using the specified directory.withExtensions
(Collection<Extension> extensions) Creates a newBuild
instance using the specified extensions.withFilters
(Collection<String> filters) Creates a newBuild
instance using the specified filters.withFinalName
(String finalName) Creates a newBuild
instance using the specified finalName.withOutputDirectory
(String outputDirectory) Creates a newBuild
instance using the specified outputDirectory.withPluginManagement
(PluginManagement pluginManagement) Creates a newBuild
instance using the specified pluginManagement.withPlugins
(Collection<Plugin> plugins) Creates a newBuild
instance using the specified plugins.withResources
(Collection<Resource> resources) Creates a newBuild
instance using the specified resources.withScriptSourceDirectory
(String scriptSourceDirectory) Creates a newBuild
instance using the specified scriptSourceDirectory.withSourceDirectory
(String sourceDirectory) Creates a newBuild
instance using the specified sourceDirectory.withTestOutputDirectory
(String testOutputDirectory) Creates a newBuild
instance using the specified testOutputDirectory.withTestResources
(Collection<Resource> testResources) Creates a newBuild
instance using the specified testResources.withTestSourceDirectory
(String testSourceDirectory) Creates a newBuild
instance using the specified testSourceDirectory.Methods inherited from class org.apache.maven.api.model.BuildBase
getDefaultGoal, getDirectory, getFilters, getFinalName, getResources, getTestResources, newBuilder, newBuilder
Methods inherited from class org.apache.maven.api.model.PluginConfiguration
getPluginManagement, newBuilder, newBuilder
Methods inherited from class org.apache.maven.api.model.PluginContainer
flushPluginMap, getPlugins, getPluginsAsMap, newBuilder, newBuilder
-
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>
-
getLocation
Gets the location of the specified field in the input source.- Specified by:
getLocation
in interfaceInputLocationTracker
- Overrides:
getLocation
in classBuildBase
-
with
Creates a new builder with this object as the basis. -
withPlugins
Creates a newBuild
instance using the specified plugins.- Overrides:
withPlugins
in classBuildBase
- Parameters:
plugins
- the newCollection<Plugin>
to use- Returns:
- a
Build
with the specified plugins
-
withPluginManagement
Creates a newBuild
instance using the specified pluginManagement.- Overrides:
withPluginManagement
in classBuildBase
- Parameters:
pluginManagement
- the newPluginManagement
to use- Returns:
- a
Build
with the specified pluginManagement
-
withDefaultGoal
Creates a newBuild
instance using the specified defaultGoal.- Overrides:
withDefaultGoal
in classBuildBase
- Parameters:
defaultGoal
- the newString
to use- Returns:
- a
Build
with the specified defaultGoal
-
withResources
Creates a newBuild
instance using the specified resources.- Overrides:
withResources
in classBuildBase
- Parameters:
resources
- the newCollection<Resource>
to use- Returns:
- a
Build
with the specified resources
-
withTestResources
Creates a newBuild
instance using the specified testResources.- Overrides:
withTestResources
in classBuildBase
- Parameters:
testResources
- the newCollection<Resource>
to use- Returns:
- a
Build
with the specified testResources
-
withDirectory
Creates a newBuild
instance using the specified directory.- Overrides:
withDirectory
in classBuildBase
- Parameters:
directory
- the newString
to use- Returns:
- a
Build
with the specified directory
-
withFinalName
Creates a newBuild
instance using the specified finalName.- Overrides:
withFinalName
in classBuildBase
- Parameters:
finalName
- the newString
to use- Returns:
- a
Build
with the specified finalName
-
withFilters
Creates a newBuild
instance using the specified filters.- Overrides:
withFilters
in classBuildBase
- Parameters:
filters
- the newCollection<String>
to use- Returns:
- a
Build
with the specified filters
-
withSourceDirectory
Creates a newBuild
instance using the specified sourceDirectory.- Parameters:
sourceDirectory
- the newString
to use- Returns:
- a
Build
with the specified sourceDirectory
-
withScriptSourceDirectory
Creates a newBuild
instance using the specified scriptSourceDirectory.- Parameters:
scriptSourceDirectory
- the newString
to use- Returns:
- a
Build
with the specified scriptSourceDirectory
-
withTestSourceDirectory
Creates a newBuild
instance using the specified testSourceDirectory.- Parameters:
testSourceDirectory
- the newString
to use- Returns:
- a
Build
with the specified testSourceDirectory
-
withOutputDirectory
Creates a newBuild
instance using the specified outputDirectory.- Parameters:
outputDirectory
- the newString
to use- Returns:
- a
Build
with the specified outputDirectory
-
withTestOutputDirectory
Creates a newBuild
instance using the specified testOutputDirectory.- Parameters:
testOutputDirectory
- the newString
to use- Returns:
- a
Build
with the specified testOutputDirectory
-
withExtensions
Creates a newBuild
instance using the specified extensions.- Parameters:
extensions
- the newCollection<Extension>
to use- Returns:
- a
Build
with the specified extensions
-
newInstance
Creates a newBuild
instance. Equivalent tonewInstance( true )
.- Returns:
- a new
Build
- See Also:
-
newInstance
Creates a newBuild
instance 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 newBuild
builder instance. Equivalent tonewBuilder( true )
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newBuild
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 newBuild
builder instance using the specified object as a basis. Equivalent tonewBuilder( from, false )
.- Parameters:
from
- theBuild
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newBuild
builder instance using the specified object as a basis.- Parameters:
from
- theBuild
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-