Class VersionInfo
java.lang.Object
org.craftercms.commons.monitoring.VersionInfo
- Direct Known Subclasses:
SysInfo
Get's current version information about:
1. Build Information from a given manifest file.
2. Name and version from a given manifest file.
- Since:
- 3.0
- Author:
- Carlos Ortiz
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringManifest key for the date in ms when the package was build.static final StringManifest key for codebase packageVersion (usually git hash or svn id).static final StringManifest key for name of the Lib/app in the jar (usually maven name tag value).static final StringManifest key for VersionInfo of the code (usually matches Mvn packageVersion)static final StringManifest Default Pathstatic final StringThe path for classes loaded from a Spring Boot JAR filestatic final StringThe path for classes loaded from a WAR file -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static ManifestfindManifest(Class<?> clazz) static VersionInfogetVersion(Class<?> clazz) Gets the current VersionInfo base on a Class that will load it's manifest file.static VersionInfogetVersion(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:
-
-
Constructor Details
-
VersionInfo
-
-
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
VersionInfopojo with the information. - Throws:
IOException- If Unable to read the Manifest file.
-
findManifest
- Throws:
IOException
-
toString
-
getPackageName
-
getPackageVersion
-
getPackageBuild
-
getPackageBuildDate
-