diff --git a/pom.xml b/pom.xml index 1de53c6..5845783 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.bwssystems.HABridge ha-bridge - 1.0.5 + 1.0.6 jar HA Bridge diff --git a/src/main/java/com/bwssystems/HABridge/Version.java b/src/main/java/com/bwssystems/HABridge/Version.java new file mode 100644 index 0000000..1e05531 --- /dev/null +++ b/src/main/java/com/bwssystems/HABridge/Version.java @@ -0,0 +1,50 @@ +package com.bwssystems.HABridge; + +import java.io.InputStream; +import java.util.Properties; + + +public final class Version { + + private String version; + private String groupId; + private String artifactId; + private Properties prop; + + public Version() + { + InputStream resourceAsStream = + (InputStream) this.getClass().getResourceAsStream( + "/version.properties" + ); + this.prop = new Properties(); + + try + { + this.prop.load( resourceAsStream ); + this.version = this.prop.getProperty("version"); + this.groupId = this.prop.getProperty("groupId"); + this.artifactId = this.prop.getProperty("artifactId"); + } + catch (Exception e) + { + this.version = "0.0.0"; + this.groupId = "no group"; + this.artifactId = "no artifact"; + } + + } + + public String getVersion() { + return version; + } + + public String getGroupId() { + return groupId; + } + + public String getArtifactId() { + return artifactId; + } + +} \ No newline at end of file