Nova Ordis Utilities Version Metadata Handling: Difference between revisions
No edit summary |
|||
Line 5: | Line 5: | ||
=Overview= | =Overview= | ||
The mechanism relies on the | The mechanism relies on a project build pattern and a set of APIs to expose the version and release data of application in a standard manner. The mechanism is used by most of the Nova Ordis [[projects]]. [[clad]] builds upon it and exposes the version and release metadata as result of the "version" command, which is available by default to all clad-based applications. | ||
<tt>VersionUtilities.getVersion()</tt> and <tt>VersionUtilities.getReleaseDate()</tt> can be used as top-level API to locate, process and display the metadata. | The mechanism relies on the presence of a "VERSION" metadata file in the application's classpath. <tt>VersionUtilities.getVersion()</tt> and <tt>VersionUtilities.getReleaseDate()</tt> can be used as top-level API to locate, process and display the metadata. In case the metadata file is not found, the both methods log the condition using SLF4J warn() and return null. | ||
In case the metadata file is not found, the both methods log the condition using SLF4J warn() and return null. | |||
In order to insure that the artifacts are built to contain version metadata, follow the instructions provided in the "[[#Build_Infrastructure_Configuration|Build Infrastructure Configuration]]" section, below. | In order to insure that the artifacts are built to contain version metadata, follow the instructions provided in the "[[#Build_Infrastructure_Configuration|Build Infrastructure Configuration]]" section, below. |
Revision as of 18:16, 16 November 2016
Internal
Overview
The mechanism relies on a project build pattern and a set of APIs to expose the version and release data of application in a standard manner. The mechanism is used by most of the Nova Ordis projects. clad builds upon it and exposes the version and release metadata as result of the "version" command, which is available by default to all clad-based applications.
The mechanism relies on the presence of a "VERSION" metadata file in the application's classpath. VersionUtilities.getVersion() and VersionUtilities.getReleaseDate() can be used as top-level API to locate, process and display the metadata. In case the metadata file is not found, the both methods log the condition using SLF4J warn() and return null.
In order to insure that the artifacts are built to contain version metadata, follow the instructions provided in the "Build Infrastructure Configuration" section, below.
Code
Build Infrastructure Configuration
- Verify that the POM file contains the definition of maven.build.timestamp.format and release_date, as required by project Version and Release Date#Define_maven.build.timestamp.format_and_release_date. If it does not, inject it.