Class 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:
  • Method Details

    • getSourceDirectory

      public String 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 is src/main/java.
      Returns:
      a String
    • getScriptSourceDirectory

      public 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 is src/main/scripts.
      Returns:
      a String
    • getTestSourceDirectory

      public 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 is src/test/java.
      Returns:
      a String
    • getOutputDirectory

      public String getOutputDirectory()
      The directory where compiled application classes are placed. The default value is target/classes.
      Returns:
      a String
    • getTestOutputDirectory

      public String getTestOutputDirectory()
      The directory where compiled test classes are placed. The default value is target/test-classes.
      Returns:
      a String
    • getExtensions

      @Nonnull public List<Extension> getExtensions()
      A set of build extensions to use from this project.
      Returns:
      a List<Extension>
    • with

      @Nonnull public Build.Builder with()
      Creates a new builder with this object as the basis.
      Overrides:
      with in class BuildBase
      Returns:
      a Builder
    • withPlugins

      @Nonnull public Build withPlugins(Collection<Plugin> plugins)
      Creates a new Build instance using the specified plugins.
      Overrides:
      withPlugins in class BuildBase
      Parameters:
      plugins - the new Collection<Plugin> to use
      Returns:
      a Build with the specified plugins
    • withPluginManagement

      @Nonnull public Build withPluginManagement(PluginManagement pluginManagement)
      Creates a new Build instance using the specified pluginManagement.
      Overrides:
      withPluginManagement in class BuildBase
      Parameters:
      pluginManagement - the new PluginManagement to use
      Returns:
      a Build with the specified pluginManagement
    • withDefaultGoal

      @Nonnull public Build withDefaultGoal(String defaultGoal)
      Creates a new Build instance using the specified defaultGoal.
      Overrides:
      withDefaultGoal in class BuildBase
      Parameters:
      defaultGoal - the new String to use
      Returns:
      a Build with the specified defaultGoal
    • withResources

      @Nonnull public Build withResources(Collection<Resource> resources)
      Creates a new Build instance using the specified resources.
      Overrides:
      withResources in class BuildBase
      Parameters:
      resources - the new Collection<Resource> to use
      Returns:
      a Build with the specified resources
    • withTestResources

      @Nonnull public Build withTestResources(Collection<Resource> testResources)
      Creates a new Build instance using the specified testResources.
      Overrides:
      withTestResources in class BuildBase
      Parameters:
      testResources - the new Collection<Resource> to use
      Returns:
      a Build with the specified testResources
    • withDirectory

      @Nonnull public Build withDirectory(String directory)
      Creates a new Build instance using the specified directory.
      Overrides:
      withDirectory in class BuildBase
      Parameters:
      directory - the new String to use
      Returns:
      a Build with the specified directory
    • withFinalName

      @Nonnull public Build withFinalName(String finalName)
      Creates a new Build instance using the specified finalName.
      Overrides:
      withFinalName in class BuildBase
      Parameters:
      finalName - the new String to use
      Returns:
      a Build with the specified finalName
    • withFilters

      @Nonnull public Build withFilters(Collection<String> filters)
      Creates a new Build instance using the specified filters.
      Overrides:
      withFilters in class BuildBase
      Parameters:
      filters - the new Collection<String> to use
      Returns:
      a Build with the specified filters
    • withSourceDirectory

      @Nonnull public Build withSourceDirectory(String sourceDirectory)
      Creates a new Build instance using the specified sourceDirectory.
      Parameters:
      sourceDirectory - the new String to use
      Returns:
      a Build with the specified sourceDirectory
    • withScriptSourceDirectory

      @Nonnull public Build withScriptSourceDirectory(String scriptSourceDirectory)
      Creates a new Build instance using the specified scriptSourceDirectory.
      Parameters:
      scriptSourceDirectory - the new String to use
      Returns:
      a Build with the specified scriptSourceDirectory
    • withTestSourceDirectory

      @Nonnull public Build withTestSourceDirectory(String testSourceDirectory)
      Creates a new Build instance using the specified testSourceDirectory.
      Parameters:
      testSourceDirectory - the new String to use
      Returns:
      a Build with the specified testSourceDirectory
    • withOutputDirectory

      @Nonnull public Build withOutputDirectory(String outputDirectory)
      Creates a new Build instance using the specified outputDirectory.
      Parameters:
      outputDirectory - the new String to use
      Returns:
      a Build with the specified outputDirectory
    • withTestOutputDirectory

      @Nonnull public Build withTestOutputDirectory(String testOutputDirectory)
      Creates a new Build instance using the specified testOutputDirectory.
      Parameters:
      testOutputDirectory - the new String to use
      Returns:
      a Build with the specified testOutputDirectory
    • withExtensions

      @Nonnull public Build withExtensions(Collection<Extension> extensions)
      Creates a new Build instance using the specified extensions.
      Parameters:
      extensions - the new Collection<Extension> to use
      Returns:
      a Build with the specified extensions
    • newInstance

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

      @Nonnull public static Build newInstance(boolean withDefaults)
      Creates a new Build 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 Build
    • newBuilder

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

      @Nonnull public static Build.Builder newBuilder(boolean withDefaults)
      Creates a new Build 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 Build.Builder newBuilder(Build from)
      Creates a new Build builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the Build instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

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

      public String toString()
      Overrides:
      toString in class BuildBase
      See Also: