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 topom
. Since v2.1.0File
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 withsystemproperty.
in the generated file.
Defaults tofalse
.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 withsystemproperty.
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 totrue
.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 withenvvar.
in the generated file.
Defaults tofalse
.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 withenvvar.
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 totrue
.boolean
formatXML
Generate build info in .XML format? It is safe to generate multiple formats in one run!
Defaults totrue
.
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 tofalse
. 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 tofalse
. 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 toMETA-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
tobuild.datetime.text
- Changed property name
build.datetime.timezone
tobuild.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
- Updated buildinfo version number to
- 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