95 |
* |
* |
96 |
* @Return the major part of the software version or 0 if a problem occurs. |
* @Return the major part of the software version or 0 if a problem occurs. |
97 |
*/ |
*/ |
98 |
public static int getVersionBuild(Class<?> clazz) { |
public static String getVersionBuild(Class<?> clazz) { |
99 |
try { |
try { |
100 |
final URL releasePropsURL = clazz |
final URL releasePropsURL = clazz |
101 |
.getResource("/release.properties"); |
.getResource("/release.properties"); |
112 |
if (str.equals("${buildNumber}")) { |
if (str.equals("${buildNumber}")) { |
113 |
// We are in development or Maven didn't filter the properties |
// We are in development or Maven didn't filter the properties |
114 |
// while building. |
// while building. |
115 |
return 0; |
return "0"; |
116 |
} |
} |
117 |
|
|
118 |
return Integer.parseInt(str); |
return str; |
119 |
} catch (final Exception e) { |
} catch (final Exception e) { |
120 |
log.error("/release.properties could not be read from " |
log.error("/release.properties could not be read from " |
121 |
+ clazz.getSimpleName(), e); |
+ clazz.getSimpleName(), e); |
122 |
return 0; |
return "0"; |
123 |
} |
} |
124 |
|
|
125 |
} |
} |