blob: a5eafe6d866ca78fb6526dab613b39d8a0670959 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package models;
import java.io.InputStream;
import java.util.Properties;
public class Version {
private static String version = null;
public static String getVersion() {
// Maven writes a version number derived from the current timestamp
// to MANIFEST.MF - read it
if (version == null) {
try {
InputStream is = Version.class
.getResourceAsStream("/META-INF/MANIFEST.MF");
Properties p = new Properties();
p.load(is);
version = p.getProperty("Version-Timestamp");
} catch (Exception e) {
e.printStackTrace();
version = "unknown";
}
}
return version;
}
}
|