public class AppInfo extends Object
Application name is as configured in the MonitoringCenter.
The build/version control data is retrieved from buildInfo.properties, which is expected to be found on the
classpath. All dates in this file are to be expressed in UTC and to follow the following format: "yyyyMMdd-HHmm".
The file should have the following properties (including Maven variables as values):
build.version = ${project.version}
build.timestamp = ${timestamp}
build.username = ${user.name}
vcs.branch = ${git.branch}
vcs.commit.id = ${git.commit.id}
vcs.commit.message = ${git.commit.message.full}
vcs.commit.timestamp = ${git.commit.time}
vcs.commit.author = ${git.commit.user.name}
The values in buildInfo.properties will be expanded by Maven or another build too via the resources filter feature. For Maven, it is recommended to employ git-commit-id-plugin to expand the git-related variables. Also, please note that in Maven the build timestamp needs to be captured into another variable (see http://stackoverflow.com/questions/13228472/how-to-acces-maven-build-timestamp-for-resource-filtering).
| Modifier and Type | Method and Description |
|---|---|
static AppInfo |
create(String applicationName) |
String |
getApplicationName()
Retrieves the application name, as specified in the MonitoringCenter configuration.
|
String |
getApplicationVersion()
Retrieves the version of the application.
|
String |
getBranchName()
Retrieves the name of the branch from which the application was built.
|
Date |
getBuildTimestamp()
Retrieves the timestamp indicating when this application was built.
|
String |
getBuildUsername()
Retrieves the username of the user who ran the application build.
|
String |
getCommitAuthor()
Retrieves the author of the most recent commit in this application's build.
|
String |
getCommitId()
Retrieves the ID of the most recent commit in this application's build.
|
String |
getCommitMessage()
Retrieves the commit message for the most recent commit in this application's build.
|
Date |
getCommitTimestamp()
Retrieves the timestamp of the most recent commit in this application's build.
|
public String getApplicationName()
public String getApplicationVersion()
public Date getBuildTimestamp()
public String getBuildUsername()
public String getBranchName()
public String getCommitId()
public String getCommitMessage()
public Date getCommitTimestamp()
public String getCommitAuthor()
Copyright © 2016–2019. All rights reserved.