Access build number from MANIFEST
How to access the build number in the WAR file (generated by the Maven build number plugin) from Java.
Copy this code and paste it in your HTML
String appServerHome
= getServletContext
().
getRealPath("/");
File manifestFile
= new File(appServerHome,
"META-INF/MANIFEST.MF");
System.
out.
println("Version: " + atts.
getValue("Implementation-Version")); System.
out.
println("Build: " + atts.
getValue("Implementation-Build"));
Report this snippet
Comments
Subscribe to comments