Page tree


Generates build metadata and provides it as Maven build properties. The properties are written to a properties file that can be included in the generated artifact. The information can also be added to the manifest file.


Red Hat Fork

There is a fork of the Buildmetadata Maven Plugin supported by a team at Red Hat.

The fork is also available as a GitHub project and their artifact is deployed to the public Maven Repository!

We are continuing with supporting our version, adding new features, and keeping close contact with the team at Red Hat. For more information please read Great News: Buildmetadata Maven Plugin forked!

version 1.7.0


This Maven plugin generates build metadata and provides it as Maven build properties. The properties are written to a properties file that can be included in the generated artifact. The information can also be added in an XML format or to the manifest file.

The metadata includes

  • SCM information
    • revision number
    • revision date
    • locally modified files
    • URL of SCM server
  • build time
  • operating system
    • name
    • architecture
    • version
  • Java runtime
    • vendor
    • name
    • version
    • virtual machine
    • compiler
  • Maven execution information
    • Maven version
    • filter files
    • active profiles
    • environment properties
    • command line and executed goals
  • build user
  • build host name
  • Artifact and version
    • group ID
    • artifact ID
    • build version
  • project info
    • home page URL
    • categories
    • tags

For detailed information about the collected metadata and the properties that store them, please consult the listing of the build properties.

If your desired metadata is not included in the list, this is no show stopper! The Provider SPI allows you to add own implementations to provide additional metadata from any source and even export build information to remote systems.

Why add Metadata to the Artifact?

Imagine the product is running on an application server. The product manager want to know,

  • which version of which artifact is currently running on that server?
  • which artifact maps to which source code version in the SCM repository?
  • what configuration set (including profiles and environment variables) has been used to generate the artifact?
  • on which machine was the artifact built?
  • when was the artifact built?

If you have no answers to these questions, but love to have, this tool is for you. It allows you to add this information easily as metadata to all kinds of Java archives.

The following sections show the artifacts provided by this plugin.

Properties File

The generated properties file is per default added to the META-INF folder of the archive and can be easily accessed at runtime. It contains the following information:

#Created by 19\:13\:00
build.copyright.year=2008-2010 HH\:mm\:ss


build.maven.execution.cmdline=clean package
build.maven.execution.goals=clean, package
build.maven.execution.opts=-Xmx2048M -XX\:MaxPermSize\=256m, basic

build.scmLocallyModified=false 18\:12\:57

Manifest File

The generated information can be used in the Manifest file, using the maven-jar-plugin.

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven

Build-Jdk: 1.6.0_20
Built-By: john.doe
Built-OS: Windows 7 / amd64 / 6.1
Built-Host: DevBox001
Java-Vendor: Sun Microsystems Inc.
Java-Version: 1.6.0_20
Maven-Version: 2.2.1

Specification-Vendor: smartics
Specification-Title: buildmetadata-maven-plugin
Specification-Version: 0.7.0

Implementation-Vendor: smartics
Implementation-Vendor-Id: de.smartics.maven.plugin
Implementation-Title: buildmetadata-maven-plugin
Implementation-Version: 0.7.0

Implementation-Date: 17.07.2010 19:13:00
Implementation-DatePattern: dd.MM.yyyy HH:mm:ss
Implementation-Timestamp: 1279386780654

Implementation-Full-Version: 0.7.0-20100717r4223

Implementation-SCM-Revision-Date: 16.07.2010 18:12:57
Implementation-SCM-Revision-Number: 4223

The information is not added automatically, but requires to be edited manually. Please refer to Use with JAR plugin for details.

Please note that other archive type can be configured similarly with e.g. the maven-ear-plugin or maven-war-plugin.


To map a site documentation to an artifact (and vice versa), a build report can be integrated into the site documentation. This report contains build information like the revision and revision date.

The Build Report of this project may serve as an example.

One Word of Warning

Build metadata may contain sensitive information you do not want to expose. If you include the commandline to document how the build has been started using

-DbuildMetaData.hideCommandLineInfo=false -Ppassword=verySecret

This line will be part of the report!

Please also note that the commandline contains the information as digested by Maven. Any variable replacements or using the alias-maven-plugin as in

p -DbuildMetaData.hideCommandLineInfo=false

(for those who do not know this plugin: p is an alias for -T 4 clean package) does not mask the commandline:

<commandline>-T 4 clean package -DbuildMetaData.hideCommandLineInfo=false</commandline>

We tried to make the default configuration very restrictive. But nonetheless we advice you to double check the build metadata you include into your artifacts. Especially if these artifacts are published to anonymous third parties.

Getting Started

Please have a look at the sample usage patterns.

The buildmetadata:provide-buildmetadata documentation details the configuration options.

Project Blog

The following posts provide more information about this plugin on our blog.

Blog Posts