Class VersionInfo
java.lang.Object
org.craftercms.commons.monitoring.VersionInfo
Get's current version information about:
1. Current VM version runs current code.
2. Build Information from a given manifest file.
3. Name and version from a given manifest file.
- Since:
- 3.0
- Author:
- Carlos Ortiz
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Manifest key for the date in ms when the package was build.static final String
Manifest key for codebase packageVersion (usually git hash or svn id).static final String
Manifest key for name of the Lib/app in the jar (usually maven name tag value).static final String
Manifest key for VersionInfo of the code (usually matches Mvn packageVersion)static final String
Manifest Default Pathstatic final String
The path for classes loaded from a Spring Boot JAR filestatic final String
The path for classes loaded from a WAR file -
Method Summary
Modifier and TypeMethodDescriptionstatic VersionInfo
getVersion
(Class clazz) Gets the current VersionInfo base on a Class that will load it's manifest file.static VersionInfo
getVersion
(Manifest manifest) Gets the current VersionInfo based on Manifest & current JVM information.toString()
-
Field Details
-
KEY_BUILD_ON
Manifest key for the date in ms when the package was build.- See Also:
-
KEY_IMPLEMENTATION_TITLE
Manifest key for name of the Lib/app in the jar (usually maven name tag value).- See Also:
-
KEY_IMPLEMENTATION_VERSION
Manifest key for VersionInfo of the code (usually matches Mvn packageVersion)- See Also:
-
KEY_IMPLEMENTATION_BUILD
Manifest key for codebase packageVersion (usually git hash or svn id).- See Also:
-
MANIFEST_PATH
Manifest Default Path- See Also:
-
WAR_PATH
The path for classes loaded from a WAR file- See Also:
-
SPRING_PATH
The path for classes loaded from a Spring Boot JAR file- See Also:
-
-
Method Details
-
getVersion
Gets the current VersionInfo based on Manifest & current JVM information.- Parameters:
manifest
- Manifest were to get the information.- Returns:
- A VersionInfo pojo with information.
-
getVersion
Gets the current VersionInfo base on a Class that will load it's manifest file.- Parameters:
clazz
- Class that will load the manifest MF file- Returns:
- A
VersionInfo
pojo with the information. - Throws:
IOException
- If Unable to read the Manifest file.
-
toString
-
getPackageName
-
getPackageVersion
-
getPackageBuild
-
getPackageBuildDate
-
getJavaVersion
-
getJavaVendor
-
getJavaVm
-
getOsName
-
getOsVersion
-
getOsArch
-