ph-buildinfo-maven-plugin

Maven plugin for emitting build information in a project

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.helger.maven
ArtifactId

ArtifactId

ph-buildinfo-maven-plugin
Last Version

Last Version

3.0.2
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

ph-buildinfo-maven-plugin
Maven plugin for emitting build information in a project
Project URL

Project URL

https://github.com/phax/ph-buildinfo-maven-plugin
Project Organization

Project Organization

Philip Helger
Source Code Management

Source Code Management

http://github.com/phax/ph-buildinfo-maven-plugin

Download ph-buildinfo-maven-plugin

How to add to project

<plugin>
    <groupId>com.helger.maven</groupId>
    <artifactId>ph-buildinfo-maven-plugin</artifactId>
    <version>3.0.2</version>
</plugin>

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.0
com.helger.commons : ph-xml jar
com.helger.commons : ph-json jar

provided (3)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.0
org.apache.maven : maven-core jar 3.0
org.apache.maven : maven-compat jar 3.0

Project Modules

There are no modules declared in this project.

ph-buildinfo-maven-plugin

A Maven 3 plugin that adds build information to the resulting artefacts. It allows to add an XML and/or a Properties file to the resulting artefact.

Maven configuration

<plugin>
  <groupId>com.helger.maven</groupId>
  <artifactId>ph-buildinfo-maven-plugin</artifactId>
  <version>3.0.1</version>
  <executions>
    <execution>
      <goals>
        <goal>generate-buildinfo</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <formatProperties>false</formatProperties>
    <formatXML>true</formatXML>
    <formatJson>false</formatJson>
    <withAllSystemProperties>true</withAllSystemProperties>
    <selectedEnvVars>
      <param>JAVA_.*</param>
      <param>M2_.*</param>
      <param>MAVEN_.*</param>
      <param>NUMBER_OF_PROCESSORS</param>
      <param>OS</param>
      <param>PROCESSOR_.*</param>
    </selectedEnvVars>
  </configuration>
</plugin>

Configuration items are:

  • HashSet <String> ignoredPackagings A set of ignored packagings for which the buildinfo plugin is not executed. Defaults to pom. Since v2.1.0
  • File tempDirectory
    The directory where the temporary buildinfo files will be saved.
    Defaults to ${project.build.directory}/buildinfo-maven-plugin
  • boolean withAllSystemProperties
    Should all system properties be emitted into the build info? If this flag is set, the selectedSystemProperties are cleared, so either this flag or the selectedSystemProperties should be used. All contained system properties are prefixed with systemproperty. in the generated file.
    Defaults to false.
  • HashSet <String> selectedSystemProperties
    A selected subset of system property names to be emitted. Each element can be a regular expression to match more than one potential system property. If this set is not empty, the withSystemProperties property should not need to be enabled. All contained system properties are prefixed with systemproperty. in the generated file.
  • HashSet<String> ignoredSystemProperties
    A selected subset of system property names to be ignored. Each element can be a regular expression to match more than one potential system property. Ignored system properties take precedence over selected system properties. They are also ignored if withAllSystemProperties is set to true.
  • boolean withAllEnvVars
    Should all environment variables be emitted into the build info? If this flag is set, the selectedEnvVars are cleared, so either this flag or the selectedEnvVars should be used. All contained environment variables are prefixed with envvar. in the generated file.
    Defaults to false.
  • HashSet <String> selectedEnvVars
    A selected subset of environment variables names to be emitted. Each element can be a regular expression to match more than one potential environment variables. If this set is not empty, the withEnvVars property does not need to be enabled. All contained environment variables are prefixed with envvar. in the generated file.
  • HashSet <String> ignoredEnvVars
    A selected subset of environment variables names to be ignored. Each element can be a regular expression to match more than one potential environment variables. Ignored environment variables take precedence over selected environment variables. They are also ignored if withAllEnvVars is set to true.
  • boolean formatXML
    Generate build info in .XML format? It is safe to generate multiple formats in one run!
    Defaults to true.
    The created file is always targetPath + buildinfo.xml.
    The generated file has the following layout:
<mapping>
  <map key="buildinfo.version" value="3" />
  <map key="project.groupid" value="com.helger.maven" />
  ...
</mapping>
  • boolean formatProperties
    Generate build info in .properties format? It is safe to generate multiple formats in one run!
    Defaults to false. The created file is always targetPath + buildinfo.properties.
  • boolean formatJson
    Generate build info in .json format? It is safe to generate multiple formats in one run!
    Defaults to false. The created file is always targetPath + buildinfo.json. Since v2.1.0.
  • String targetPath Set the target path inside the final artefact where the files should be located. Defaults to META-INF. Since v2.1.0.

News and noteworthy

  • v3.0.2 - 2021-03-22
    • Updated to ph-commons 10
  • v3.0.1 - 2020-03-11
    • Release with recent library versions
  • v3.0.0 - 2018-08-06
    • Updated to ph-commons 9.0.0
  • v2.1.0 - 2017-04-11
    • Updated buildinfo version number to 3
      • List of active profiles were added to build info output
      • Changed property name build.datetime to build.datetime.text
      • Changed property name build.datetime.timezone to build.datetime.timezone.id
    • Switched to Maven plugin annotations
    • Marked as thread-safe
    • Timezone is now considered
    • Added new property ignoredPackagings to define Maven packagings to be ignored for this plugin.
    • Added new property targetPath to define the path in the final artefact
    • Added support for writing JSON buildinfo files
  • v2.0.0 - 2016-07-01
    • Updated to Java 8
  • v1.3.0 - 2015-08-31
    • First version to require Maven 3.0
    • Removed manual SLF4J integration
    • Added support for Eclipse m2e plugin
  • v1.2.2 - 2015-03-11
    • Last version to support Maven 2.x
  • v1.2.1 - 2014-09-02
    • Tried to make compatible with Maven 2.2.1
  • v1.2.0 - 2014-08-26

My personal Coding Styleguide | On Twitter: @philiphelger | Kindly supported by YourKit Java Profiler

Versions

Version
3.0.2
3.0.1
3.0.0
2.1.0
2.0.0
1.3.0
1.2.2
1.2.1
1.2.0