Skip to content

Instantly share code, notes, and snippets.

@MaximeFrancoeur
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaximeFrancoeur/1ed430e96c32b649e0b8 to your computer and use it in GitHub Desktop.
Save MaximeFrancoeur/1ed430e96c32b649e0b8 to your computer and use it in GitHub Desktop.
public class PomVersion {
final private static Logger LOGGER = LogManager.getLogger(PomVersion.class);
final static String VERSION = loadVersion();
private static String loadVersion() {
Properties properties = new Properties();
try {
InputStream inStream = PomVersion.class.getClassLoader().getResourceAsStream("version.properties");
properties.load(inStream);
} catch (Exception e){
LOGGER.warn("Unable to load version.properties using PomVersion.class.getClassLoader().getResourceAsStream(...)", e);
}
return properties.getProperty("pom.version");
}
public static String getVersion(){
return VERSION;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment