buildmetadata:build-point

Full name:

de.smartics.maven.plugin:buildmetadata-maven-plugin:1.7.0:build-point

Description:

Adds the build time to the properties file and runs all providers flagged with Provider.RUN_AT_BUILD_POINT .

Attributes:

  • Requires a Maven project to be executed.
  • The goal is thread-safe and supports parallel builds.
  • Since version: 1.0.
  • Binds by default to the lifecycle phase: prepare-package.

Required Parameters

Name Type Since Description
settingsSecurityLocation String 1.4.0 The location of the settings-security.xml.

Optional Parameters

Name Type Since Description
activateOutputFileMapping boolean 1.1 Used to activate the default mapping that writes the build properties of deployable units to ${project.build.directory}/${project.build.finalName}/META-INF/build.properties and for standard JAR files to ${project.build.outputDirectory}/META-INF/build.properties.

This property is used for the properties and XML build file.


Default value is: true.
addToFilters boolean 1.0 Flag to indicate whether or not the generated properties file should be added to the projects filters.

Filters are only added temporarily (read in-memory during the build) and are not written to the POM.


Default value is: true.
User property is: buildMetaData.addToFilters.
createManifestFile boolean 1.5 Flag to choose whether (true) or not (false) the Manifest file should be created.
Default value is: false.
createPropertiesReport boolean 1.2 Flag to choose whether (true) or not (false) the build.properties file should be created.

This will adjust the path of the propertiesOutputFile to ${project.build.directory}/build.properties.


Default value is: true.
createXmlReport boolean 1.0 Flag to choose whether (true) or not (false) the XML report should be created.
Default value is: true.
manifestFile File 1.5 The location of the Manifest file to add the buildmetadata properties to.
Default value is: ${project.build.outputDirectory}/META-INF/MANIFEST.MF.
manifestSection String 1.5 The name of the section within the Manifest file to write the buildmetadata properties to. Use "Main" to write the the main section.
Default value is: BuildMetaData.
name String 1.0 The name of the build point to append to the duration property name. If blank, the duration property will be stored as build.duration.

This way build durations may be taken from different phases of the build.


pluginSelectors List 1.5 Selects properties from plugin configurations.

Add a list of selectors like this:

<pluginSelectors>
<selector>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<keyPrefix>build.runtime.java.compiler.</keyPrefix>
<properties>
<property>source</property>
<property>target</property>
</properties>
</selector>
<selector>
...
</selector>
</pluginSelectors>
  • groupId - the group identifier of the plugin to select
  • artifactId - the artifact identifier of the plugin to select
  • keyPrefix - the optional prefix to add to the config property
  • properties - the list of config properties to select

Currently only simple key value pairs are selectable.


properties List 1.0 The list of a system properties or environment variables to be selected by the user to include into the build meta data properties.

The name is the name of the property, the section is relevant for placing the property in one of the following sections:

  • build.scm
  • build.dateAndVersion
  • build.runtime
  • build.java
  • build.maven
  • project
  • build.misc

If no valid section is given, the property is silently rendered in the build.misc section.


propertiesOutputFile File 1.0 The name of the properties file to write. Per default this value is overridden by packaging dependent locations. Please refer to activatePropertyOutputFileMapping for details.
Default value is: ${project.build.outputDirectory}/META-INF/build.properties.
propertyOutputFileMapping List 1.1 Maps a packaging to a location for the build meta data properties file.

This mapping is especially useful for multi projects.


providers List 1.0 The list of meta data providers to launch that contribute to the meta data.
remoteVersion String 1.4.0 The branch or tag version on the remote server to compare against. If unset, the SCM status will be used to determine the differences.

For SVN, leave it blank. For Git, set the version on the remote server (the project's SCM URL points to).


skip boolean 1.0 A simple flag to skip the generation of the build information. If set on the command line use -DbuildMetaData.skip.

Supported by the build point mojo since version 1.5.


Default value is: false.
User property is: buildMetaData.skip.
skipModules boolean 1.5.0 Flag to indicate that the buildmetadata must only be added for the root project. Modules will be skipped.
Default value is: false.
writeProtectFiles boolean 1.5 Flag to choose whether (true) or not (false) to write protect the generated buildmetadata files. Protecting them allows to projects that copy files from different resources together to not override them by other plugins.
Default value is: false.
xmlOutputFile File 1.0 The name of the XML report file to write. If you want to include the XML file in the artifact, use ${project.build.outputDirectory}/META-INF/buildmetadata.xml.

The handling is not in an analogous manner as that of the properties file. The reason is this: we want to keep the artifact as small as possible per default. Therefore we include the build.properties and generate the XML report (see property createXmlReport to the target folder (and not inside META-INF). The XML file can be stored to the artifact server (with a couple of other reports) by the use of the projectmetadata-maven-plugin.


Default value is: ${project.build.directory}/buildmetadata.xml.
xmlOutputFileMapping List 1.3 Maps a packaging to a location for the build meta data XML file.

This mapping is especially useful for multi projects.


Parameter Details

activateOutputFileMapping:

Used to activate the default mapping that writes the build properties of deployable units to ${project.build.directory}/${project.build.finalName}/META-INF/build.properties and for standard JAR files to ${project.build.outputDirectory}/META-INF/build.properties.

This property is used for the properties and XML build file.

  • Type: boolean
  • Since: 1.1
  • Required: No
  • Default: true

addToFilters:

Flag to indicate whether or not the generated properties file should be added to the projects filters.

Filters are only added temporarily (read in-memory during the build) and are not written to the POM.

  • Type: boolean
  • Since: 1.0
  • Required: No
  • User Property: buildMetaData.addToFilters
  • Default: true

createManifestFile:

Flag to choose whether (true) or not (false) the Manifest file should be created.
  • Type: boolean
  • Since: 1.5
  • Required: No
  • Default: false

createPropertiesReport:

Flag to choose whether (true) or not (false) the build.properties file should be created.

This will adjust the path of the propertiesOutputFile to ${project.build.directory}/build.properties.

  • Type: boolean
  • Since: 1.2
  • Required: No
  • Default: true

createXmlReport:

Flag to choose whether (true) or not (false) the XML report should be created.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • Default: true

manifestFile:

The location of the Manifest file to add the buildmetadata properties to.
  • Type: java.io.File
  • Since: 1.5
  • Required: No
  • Default: ${project.build.outputDirectory}/META-INF/MANIFEST.MF

manifestSection:

The name of the section within the Manifest file to write the buildmetadata properties to. Use "Main" to write the the main section.
  • Type: java.lang.String
  • Since: 1.5
  • Required: No
  • Default: BuildMetaData

name:

The name of the build point to append to the duration property name. If blank, the duration property will be stored as build.duration.

This way build durations may be taken from different phases of the build.

  • Type: java.lang.String
  • Since: 1.0
  • Required: No

pluginSelectors:

Selects properties from plugin configurations.

Add a list of selectors like this:

<pluginSelectors>
<selector>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<keyPrefix>build.runtime.java.compiler.</keyPrefix>
<properties>
<property>source</property>
<property>target</property>
</properties>
</selector>
<selector>
...
</selector>
</pluginSelectors>
  • groupId - the group identifier of the plugin to select
  • artifactId - the artifact identifier of the plugin to select
  • keyPrefix - the optional prefix to add to the config property
  • properties - the list of config properties to select

Currently only simple key value pairs are selectable.

  • Type: java.util.List
  • Since: 1.5
  • Required: No

properties:

The list of a system properties or environment variables to be selected by the user to include into the build meta data properties.

The name is the name of the property, the section is relevant for placing the property in one of the following sections:

  • build.scm
  • build.dateAndVersion
  • build.runtime
  • build.java
  • build.maven
  • project
  • build.misc

If no valid section is given, the property is silently rendered in the build.misc section.

  • Type: java.util.List
  • Since: 1.0
  • Required: No

propertiesOutputFile:

The name of the properties file to write. Per default this value is overridden by packaging dependent locations. Please refer to activatePropertyOutputFileMapping for details.
  • Type: java.io.File
  • Since: 1.0
  • Required: No
  • Default: ${project.build.outputDirectory}/META-INF/build.properties

propertyOutputFileMapping:

Maps a packaging to a location for the build meta data properties file.

This mapping is especially useful for multi projects.

  • Type: java.util.List
  • Since: 1.1
  • Required: No

providers:

The list of meta data providers to launch that contribute to the meta data.
  • Type: java.util.List
  • Since: 1.0
  • Required: No

remoteVersion:

The branch or tag version on the remote server to compare against. If unset, the SCM status will be used to determine the differences.

For SVN, leave it blank. For Git, set the version on the remote server (the project's SCM URL points to).

  • Type: java.lang.String
  • Since: 1.4.0
  • Required: No

settingsSecurityLocation:

The location of the settings-security.xml.
  • Type: java.lang.String
  • Since: 1.4.0
  • Required: Yes
  • Expression: ${user.home}/.m2/settings-security.xml

skip:

A simple flag to skip the generation of the build information. If set on the command line use -DbuildMetaData.skip.

Supported by the build point mojo since version 1.5.

  • Type: boolean
  • Since: 1.0
  • Required: No
  • User Property: buildMetaData.skip
  • Default: false

skipModules:

Flag to indicate that the buildmetadata must only be added for the root project. Modules will be skipped.
  • Type: boolean
  • Since: 1.5.0
  • Required: No
  • Default: false

writeProtectFiles:

Flag to choose whether (true) or not (false) to write protect the generated buildmetadata files. Protecting them allows to projects that copy files from different resources together to not override them by other plugins.
  • Type: boolean
  • Since: 1.5
  • Required: No
  • Default: false

xmlOutputFile:

The name of the XML report file to write. If you want to include the XML file in the artifact, use ${project.build.outputDirectory}/META-INF/buildmetadata.xml.

The handling is not in an analogous manner as that of the properties file. The reason is this: we want to keep the artifact as small as possible per default. Therefore we include the build.properties and generate the XML report (see property createXmlReport to the target folder (and not inside META-INF). The XML file can be stored to the artifact server (with a couple of other reports) by the use of the projectmetadata-maven-plugin.

  • Type: java.io.File
  • Since: 1.0
  • Required: No
  • Default: ${project.build.directory}/buildmetadata.xml

xmlOutputFileMapping:

Maps a packaging to a location for the build meta data XML file.

This mapping is especially useful for multi projects.

  • Type: java.util.List
  • Since: 1.3
  • Required: No