beadledom-common

Overview

This project contains the tooling to create the service specific build information.

Download

Download using Maven:

<dependency>
    <groupId>com.cerner.beadledom</groupId>
    <artifactId>beadledom-common</artifactId>
    <version>[insert latest version]</version>
</dependency>

Usage

<plugins/>
  ...
  <plugin/>
    <groupId/>pl.project13.maven</groupId/>
    <artifactId/>git-commit-id-plugin</artifactId/>
  </plugin/>
      ...
</plugins/>
  • Add the build-info.properties in the class path (for example in the project resources directory - src/main/resources/com/cerner/mypackage/build-info.properties).
//build-info.properties
//Required Properties
git.commit.id=${git.commit.id}
project.artifactId=docs
project.groupId=com.cerner.beadledom
project.version=2.4

//Optional Properties
project.build.date=${mvn.build.timestamp}

Note

project.build.date is an optional property, that requires you to define a new property because maven prevents the maven.build.timestamp property from getting passed to the filtering resource. This work around is needed because of this issue: https://issues.apache.org/jira/browse/MRESOURCES-99.

<properties>
   <mvn.build.timestamp>2017-02-16T20:56:40Z</mvn.build.timestamp>
<properties>
  • Filter the resource directory - if the build-info.properties file is added to the resource directory.
<build>
  ...
  <resources>
  ...
    <resource>
      <directory>src/main/resources</directory>
      <filtering>true</filtering>
    </resource>
    ...
  </resources>
  ...
</build>
  • Load the build info.
BuildInfo buildInfo = BuildInfo.load("/path/to/build-info.properties");
  • Create the ServiceMetadata.
ServiceMetadata serviceMetadata = ServiceMetadata.create(buildInfo);