从 MANIFEST 获取编译的版本号,manifest版本号,String appSe
分享于 点击 14691 次 点评:275
从 MANIFEST 获取编译的版本号,manifest版本号,String appSe
String appServerHome = getServletContext().getRealPath("/");File manifestFile = new File(appServerHome, "META-INF/MANIFEST.MF");Manifest mf = new Manifest();mf.read(new FileInputStream(manifestFile));Attributes atts = mf.getMainAttributes();System.out.println("Version: " + atts.getValue("Implementation-Version"));System.out.println("Build: " + atts.getValue("Implementation-Build"));//该片段来自于http://byrx.net
用户点评