buildmetadata:provide-buildmetadata

Full name:

de.smartics.maven.plugin:maven-buildmetadata-plugin:1.1.5:provide-buildmetadata

Description:

Provides the build information defined in Constant. This information is also written to a properties file.

Attributes:

  • Requires a Maven 2.0 project to be executed.
  • Since version: 1.0.
  • Binds by default to the lifecycle phase: initialize.

Required Parameters

Name Type Since Description
basedir File 1.0 Input dir. Directory where the files under SCM control are located.
connectionType String 1.0 Allows the user to choose which scm connection to use when connecting to the scm. Can either be "connection" or "developerConnection".
Default value is: connection.
scmDateFormat String 1.0 Used to specify the date format of the log entries that are retrieved from your SCM system.
Default value is: yyyy-MM-dd HH:mm:ss.

Optional Parameters

Name Type Since Description
activatePropertyOutputFileMapping 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.
Default value is: true.
addBuildDateToFullVersion boolean 1.0 Flag to add the build date to the full version separated by a '-'. If true the build date is added, if false it is not.
Default value is: true.
addEnvInfo boolean 1.0 Add environment variables if set to true, skip it, if set to false. If you are not interested in the environment variables of the host (e.g. for security reasons), set this to false.

For security reasons you may want to remove the properties file from the META-INF folder. Please refer to propertiesOutputFile property.


Default value is: false.
addHostInfo boolean 1.0 Add host information if set to true, skip it, if set to false. If you are not interested in host information (e.g. for security reasons), set this to false.

For security reasons you may want to remove the properties file from the META-INF folder. Please refer to propertiesOutputFile property.


Default value is: true.
addJavaRuntimeInfo boolean 1.0 Add information about the Java runtime running the build if set to true, skip it, if set to false.
Default value is: true.
addLocallyModifiedTagToFullVersion boolean 1.0 Flag to add the tag -locally-modified to the full version string to make visible that this artifact has been created with locally modified sources. This is often the case while the artifact is built while still working on an issue before it is committed to the SCM repository.
Default value is: true.
addMavenExecutionInfo boolean 1.0 Add Maven execution information (all properties starting with build.maven.execution, like command line, goals, profiles, etc.) if set to true, skip it, if set to false. If you are not interested in execution information, set this to false.

For security reasons you may want to remove the properties file from the META-INF folder. Please refer to propertiesOutputFile property.


Default value is: true.
addOsInfo boolean 1.0 Add information about the operating system the build is run in if set to true, skip it, if set to false.
Default value is: true.
addProjectInfo boolean 1.1 Add project information (homepage URL, categories, tags, etc.) if set to true, skip it, if set to false. If you are not interested in execution information, set this to false.
Default value is: false.
addReleaseNumberToFullVersion boolean 1.0 Flag to add the revision number to the full version separated by an 'r'. If true the revision number is added, if false it is not.
Default value is: true.
addScmInfo boolean 1.0 Add SCM information if set to true, skip it, if set to false. If you are not interested in SCM information, set this to false.

For security reasons you may want to remove the properties file from the META-INF folder. Please refer to propertiesOutputFile property.


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.
buildDatePattern String 1.0 The date pattern to use to format the build and revision dates. Please refer to the SimpleDateFormat class for valid patterns.
Default value is: dd.MM.yyyy.
buildUserPropertyName String 1.0 The property to query for the build user.
Default value is: username.
createXmlReport boolean 1.0 Flag to choose whether (true) or not (false) the XML report should be created.
Default value is: true.
failOnLocalModifications boolean 1.0 Flag to fail if local modifications have been found. The value is true if the build should fail if there are modifications (any files not in-sync with the remote repository), false if the fact is only to be noted in the build properties.
Default value is: false.
failOnMissingRevision boolean 1.0 Fail if revision is requested to be retrieved, access to SCM is provided, system is online, nothing should prevent the build from fetching the information.

If set to true the build will fail, if revision cannot be fetched under the conditions mentioned above. If set to false the build will continue silently so that the meta data do not contain the revision.


Default value is: false.
forceNewProperties boolean 1.0 If set to true, build properties will be generate even if they already exist in the target folder.
Default value is: false.
hideCommandLineInfo boolean 1.0 While the command line may be useful to refer to for a couple of reasons, displaying it with the build properties is a security issue. Some plugins allow to read passwords as properties from the command line and this sensible data will be shown.

Therefore the command line is hidden by default (true). If you want to include this information, use a value of false.


Default value is: true.
hideJavaOptsInfo boolean 1.0 While the JAVA_OPTS may be useful to refer to for a couple of reasons, displaying them with the build properties is a security issue. Some plugins allow to read passwords as properties from the command line and this sensible data will be shown.

Therefore the JAVA_OPTS are hidden by default ( true). If you want to include this information, use a value of false.

This exclusion does not prevent the property from being written as part of addEnvInfo!


Default value is: true.
hideMavenOptsInfo boolean 1.0 While the MAVEN_OPTS may be useful to refer to for a couple of reasons, displaying them with the build properties is a security issue. Some plugins allow to read passwords as properties from the command line and this sensible data will be shown.

Therefore the MAVEN_OPTS are hidden by default ( true). If you want to include this information, use a value of false.

This exclusion does not prevent the property from being written as part of addEnvInfo!


Default value is: true.
ignoreDotFilesInBaseDir boolean 1.0 The flag to ignore files and directories starting with a dot for checking modified files. This implicates that any files or directories, starting with a dot, are ignored when the check on changed files is run. If the value is true, dot files are ignored, if it is set to false, dot files are respected.
Default value is: true.
logLevel String 1.0 Specifies the log level used for this plugin.

Allowed values are SEVERE, WARNING, INFO and FINEST.


passphrase String 1.0 The passphrase (used by java svn).
password String 1.0 The user password (used by svn and starteam protocol).
privateKey String 1.0 The private key (used by java svn).
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.
queryRangeInDays int 1.0 The range of the query in days to fetch change log entries from the SCM. If no change logs have been found, the range is incremented up to DEFAULT_RETRY_COUNT (5) times. If no change log has been found after these DEFAULT_RETRY_COUNT (5) additional queries, the revision number will not be set with a valid value.
Default value is: 30.
skip boolean 1.0 A simple flag to skip the generation of the build information. If set on the command line use -DbuildMetaData.skip.
Default value is: false.
tagBase String 1.0 The url of tags base directory (used by svn protocol).
userName String 1.0 The user name (used by svn and starteam protocol).
validateCheckout boolean 1.0 If it should be checked if the local files are up-to-date with the remote files in the SCM repository. If the value is true the result of the check, including the list of changed files, is added to the build meta data.
Default value is: true.
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.
Default value is: ${project.build.directory}/buildmetadata.xml.

Parameter Details

activatePropertyOutputFileMapping:

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.
  • Type: boolean
  • Since: 1.1
  • Required: No
  • Default: true

addBuildDateToFullVersion:

Flag to add the build date to the full version separated by a '-'. If true the build date is added, if false it is not.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.addBuildDateToFullVersion}
  • Default: true

addEnvInfo:

Add environment variables if set to true, skip it, if set to false. If you are not interested in the environment variables of the host (e.g. for security reasons), set this to false.

For security reasons you may want to remove the properties file from the META-INF folder. Please refer to propertiesOutputFile property.

  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.addEnvInfo}
  • Default: false

addHostInfo:

Add host information if set to true, skip it, if set to false. If you are not interested in host information (e.g. for security reasons), set this to false.

For security reasons you may want to remove the properties file from the META-INF folder. Please refer to propertiesOutputFile property.

  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.addHostInfo}
  • Default: true

addJavaRuntimeInfo:

Add information about the Java runtime running the build if set to true, skip it, if set to false.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.addJavaRuntimeInfo}
  • Default: true

addLocallyModifiedTagToFullVersion:

Flag to add the tag -locally-modified to the full version string to make visible that this artifact has been created with locally modified sources. This is often the case while the artifact is built while still working on an issue before it is committed to the SCM repository.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.addLocallyModifiedTagToFullVersion}
  • Default: true

addMavenExecutionInfo:

Add Maven execution information (all properties starting with build.maven.execution, like command line, goals, profiles, etc.) if set to true, skip it, if set to false. If you are not interested in execution information, set this to false.

For security reasons you may want to remove the properties file from the META-INF folder. Please refer to propertiesOutputFile property.

  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.addMavenExecutionInfo}
  • Default: true

addOsInfo:

Add information about the operating system the build is run in if set to true, skip it, if set to false.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.addOsInfo}
  • Default: true

addProjectInfo:

Add project information (homepage URL, categories, tags, etc.) if set to true, skip it, if set to false. If you are not interested in execution information, set this to false.
  • Type: boolean
  • Since: 1.1
  • Required: No
  • Expression: ${buildMetaData.addProjectInfo}
  • Default: false

addReleaseNumberToFullVersion:

Flag to add the revision number to the full version separated by an 'r'. If true the revision number is added, if false it is not.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.addReleaseNumberToFullVersion}
  • Default: true

addScmInfo:

Add SCM information if set to true, skip it, if set to false. If you are not interested in SCM information, set this to false.

For security reasons you may want to remove the properties file from the META-INF folder. Please refer to propertiesOutputFile property.

  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.addScmInfo}
  • 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
  • Expression: ${buildMetaData.addToFilters}
  • Default: true

basedir:

Input dir. Directory where the files under SCM control are located.
  • Type: java.io.File
  • Since: 1.0
  • Required: Yes
  • Expression: ${basedir}

buildDatePattern:

The date pattern to use to format the build and revision dates. Please refer to the SimpleDateFormat class for valid patterns.
  • Type: java.lang.String
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.buildDate.pattern}
  • Default: dd.MM.yyyy

buildUserPropertyName:

The property to query for the build user.
  • Type: java.lang.String
  • Since: 1.0
  • Required: No
  • Default: username

connectionType:

Allows the user to choose which scm connection to use when connecting to the scm. Can either be "connection" or "developerConnection".
  • Type: java.lang.String
  • Since: 1.0
  • Required: Yes
  • Default: connection

createXmlReport:

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

failOnLocalModifications:

Flag to fail if local modifications have been found. The value is true if the build should fail if there are modifications (any files not in-sync with the remote repository), false if the fact is only to be noted in the build properties.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • Default: false

failOnMissingRevision:

Fail if revision is requested to be retrieved, access to SCM is provided, system is online, nothing should prevent the build from fetching the information.

If set to true the build will fail, if revision cannot be fetched under the conditions mentioned above. If set to false the build will continue silently so that the meta data do not contain the revision.

  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.failOnMissingRevision}
  • Default: false

forceNewProperties:

If set to true, build properties will be generate even if they already exist in the target folder.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • Default: false

hideCommandLineInfo:

While the command line may be useful to refer to for a couple of reasons, displaying it with the build properties is a security issue. Some plugins allow to read passwords as properties from the command line and this sensible data will be shown.

Therefore the command line is hidden by default (true). If you want to include this information, use a value of false.

  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.hideCommandLineInfo}
  • Default: true

hideJavaOptsInfo:

While the JAVA_OPTS may be useful to refer to for a couple of reasons, displaying them with the build properties is a security issue. Some plugins allow to read passwords as properties from the command line and this sensible data will be shown.

Therefore the JAVA_OPTS are hidden by default ( true). If you want to include this information, use a value of false.

This exclusion does not prevent the property from being written as part of addEnvInfo!

  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.hideJavaOptsInfo}
  • Default: true

hideMavenOptsInfo:

While the MAVEN_OPTS may be useful to refer to for a couple of reasons, displaying them with the build properties is a security issue. Some plugins allow to read passwords as properties from the command line and this sensible data will be shown.

Therefore the MAVEN_OPTS are hidden by default ( true). If you want to include this information, use a value of false.

This exclusion does not prevent the property from being written as part of addEnvInfo!

  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.hideMavenOptsInfo}
  • Default: true

ignoreDotFilesInBaseDir:

The flag to ignore files and directories starting with a dot for checking modified files. This implicates that any files or directories, starting with a dot, are ignored when the check on changed files is run. If the value is true, dot files are ignored, if it is set to false, dot files are respected.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • Default: true

logLevel:

Specifies the log level used for this plugin.

Allowed values are SEVERE, WARNING, INFO and FINEST.

  • Type: java.lang.String
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.logLevel}

passphrase:

The passphrase (used by java svn).
  • Type: java.lang.String
  • Since: 1.0
  • Required: No
  • Expression: ${passphrase}

password:

The user password (used by svn and starteam protocol).
  • Type: java.lang.String
  • Since: 1.0
  • Required: No
  • Expression: ${password}

privateKey:

The private key (used by java svn).
  • Type: java.lang.String
  • Since: 1.0
  • Required: No
  • Expression: ${privateKey}

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

queryRangeInDays:

The range of the query in days to fetch change log entries from the SCM. If no change logs have been found, the range is incremented up to DEFAULT_RETRY_COUNT (5) times. If no change log has been found after these DEFAULT_RETRY_COUNT (5) additional queries, the revision number will not be set with a valid value.
  • Type: int
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.queryRangeInDays}
  • Default: 30

scmDateFormat:

Used to specify the date format of the log entries that are retrieved from your SCM system.
  • Type: java.lang.String
  • Since: 1.0
  • Required: Yes
  • Expression: ${changelog.dateFormat}
  • Default: yyyy-MM-dd HH:mm:ss

skip:

A simple flag to skip the generation of the build information. If set on the command line use -DbuildMetaData.skip.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.skip}
  • Default: false

tagBase:

The url of tags base directory (used by svn protocol).
  • Type: java.lang.String
  • Since: 1.0
  • Required: No
  • Expression: ${tagBase}

userName:

The user name (used by svn and starteam protocol).
  • Type: java.lang.String
  • Since: 1.0
  • Required: No
  • Expression: ${username}

validateCheckout:

If it should be checked if the local files are up-to-date with the remote files in the SCM repository. If the value is true the result of the check, including the list of changed files, is added to the build meta data.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${buildMetaData.validateCheckout}
  • Default: true

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.
  • Type: java.io.File
  • Since: 1.0
  • Required: No
  • Default: ${project.build.directory}/buildmetadata.xml