Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Document Properties Marker
doctypeproject
hidetrue
extract-short-desctrue
render-asdefinition-list


Short DescriptionGenerates 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.
Doctypeprojecthide
NameBuildmetadata Maven Plugin
Tags

Tag List
namesPlugin for Maven, maven-plugin, metadata


Site URLhttps://www.smartics.eu/buildmetadata-maven-pluginhide
SiteSitehide
Short NameBuildmetadatahide
Project Logo

hide
Small Project Logo

hide
Plugin Logo

Display Property
property-nameProject Logo

Display Property
property-nameShort Name

hide, is-block
Small Plugin Logo

Display Property
property-nameSmall Project Logo

Display Property
property-nameShort Name

hide, is-block
LicenseAPL 2.0hide
Status
Status
subtletrue
colourGreen
titleproduction
hide
Sort Keyhide
project-group-idde.smartics.maven.pluginhide
project-artifact-idbuildmetadata-maven-pluginhide
project-version1.7.0hide
project.packagingmaven-pluginhide
render-metadata-asdefinition-listhide
nexus-default-repo-idpublichide
Maven Centraltruehide
url-site https://www.smartics.eu/public/${project-group-id}/${project-artifact-id}/${project-version}hide
url-githttps://github.com/smartics/buildmetadata-maven-plugin/tree/7038eeecb71b8acae6db4cb134485695b9e92301hide
url-subversion https://www.smartics.eu/svn/public/maven/buildmetadata-maven-plugin/tags hide
url-svnhttps://www.smartics.eu/svn/public/maven/buildmetadata-maven-plugin/tags/${project-artifact-id}-${project-version}hide
documentation-json-urihttps://www.smartics.eu/confluence/download/attachments/12156954/docmap.json?api=v2hide



Panel
borderStylenone

Livesearch
spaceKeyBMMP
sizelarge
placeholderSearch in this space




Panel
bgColor#FFFFF0
borderStylenone

Overview

  • Introduction
  • System Link
    fileplugin-info.html
    system-typesite
    labelGoals
  • System Link
    fileusage.html
    system-typesite
    labelUsage
  • FAQs


Panel
bgColor#FFFFF0
borderStylenone

Display List
doctypetopic
where$<Tags> = [Main]


Panel
bgColor#FFFFF0
borderStylenone

References

  • 114098269
  • System Link
    fileproject-info.html
    system-typesite
    labelProject Information Systems
    • System Link
      fileissue-tracking.html
      system-typesite
      labelIssue Tracking
    • System Link
      filesource-repository.html
      system-typesite
      labelSource Repository
    • System Link
      system-typesite
      labelReport Site
  • Download


Panel
bgColor#FFFFF0
borderStylenone

Legal Stuff

  • System Link
    filelicense.html
    system-typesite
    labelLicense
  • System Link
    filecredits.html
    system-typesite
    labelCredits
  • Impressum
  • System Link
    fileteam-list.html
    system-typesite
    labelTeam


Content Marker
idRed Hat Fork


Panel
borderColordarkgreen
titleColorwhite
titleBGColordarkgreen
titleRed 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!



Transclusion
documentHOMESPACE:Try projectdoc Teaser
idsContent



version 

Nexus Link
system-idcentral
nexus-repo-id#


Section
titleIntroduction

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

Section


Column
  • 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
    • JAVA_OPTS


Column
  • Maven execution information
    • Maven version
    • filter files
    • active profiles
    • environment properties
    • command line and executed goals
    • MAVEN_OPTS
  • 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.

Section
level2
titleWhy 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.


Section
level2
titleProperties 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:

Code Block
languagetext
#Created by buildmetadata-maven-plugin.build.date=17.07.2010 19\:13\:00
build.copyright.year=2008-2010
build.date.pattern=dd.MM.yyyy HH\:mm\:ss
build.timestamp.millis=1279386780654
build.year=2010

build.version=0.7.0
build.version.full=0.7.0-20100717r4223

build.host.name=DevBox001
build.user=john.doe

build.maven.execution.cmdline=clean package
build.maven.execution.goals=clean, package
build.maven.execution.isRoot=true
build.maven.execution.opts=-Xmx2048M -XX\:MaxPermSize\=256m
build.maven.execution.profile.active.basic=settings.xml
build.maven.execution.profile.active.nexus=settings.xml
build.maven.execution.profiles.active=nexus, basic
build.maven.version=2.2.1

build.scmLocallyModified=false
build.scmRevision.date=16.07.2010 18\:12\:57
build.scmRevision.id=4223
build.scmRevision.url=scm\:svn\:https\://smartics.info/svn/smartics/maven/buildmetadata-maven-plugin/trunk



Section
level2
titleManifest File

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

Code Block
languagetext
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-URL: http://project.smartics.de/public/de.smartics.mave
 n.plugin/buildmetadata-maven-plugin/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.

Section
level2
titleReport

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.



Section
titleOne 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

Code Block
languagetext
-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

Code Block
languagetext
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:

Code Block
languagexml
<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.


Section
titleGetting Started

Please have a look at the sample usage patterns.

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


Section
level2
titleProject Blog

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

Blog Posts
spacesBLOG
sortcreation
reversetrue
contenttitles
labelsbuildmetadata-maven-plugin


Piwik Set Multiple Custom Variables


NameValue
Departmentopen-source
Categorymaven-plugin
Typebuildmetadata-maven-plugin