diff --git a/pom.xml b/pom.xml index 4f353db7cf372642f1dfbddfa72de6ecbed3de39..48ff63d14221b1e9e6510ad86bc2e85a83dabf6f 100755 --- a/pom.xml +++ b/pom.xml @@ -166,6 +166,7 @@ <configuration> <doCheck>true</doCheck> <doUpdate>true</doUpdate> + <shortRevisionLength>5</shortRevisionLength> </configuration> </plugin> <plugin> @@ -173,8 +174,8 @@ <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> - <source>1.7</source> - <target>1.7</target> + <source>1.8</source> + <target>1.8</target> </configuration> </plugin> <plugin> @@ -214,6 +215,11 @@ </executions> </plugin> </plugins> + <resources> + <resource> + <directory>resources/build.properties</directory> + <filtering>true</filtering> + </resource> + </resources> </build> - </project> diff --git a/src/main/java/com/comandante/creeper/Main.java b/src/main/java/com/comandante/creeper/Main.java index 40ff3f2d525e196734bb5d8a20eb88b3a6e06bb2..e2058d3cdfc72bf85949ac68ca7abe8a1a195eee 100644 --- a/src/main/java/com/comandante/creeper/Main.java +++ b/src/main/java/com/comandante/creeper/Main.java @@ -24,11 +24,16 @@ import org.mapdb.DB; import org.mapdb.DBMaker; import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; import java.net.InetSocketAddress; import java.util.Arrays; import java.util.HashSet; +import java.util.Properties; import java.util.Set; import java.util.concurrent.TimeUnit; +import java.util.jar.JarInputStream; +import java.util.jar.Manifest; public class Main { @@ -36,10 +41,21 @@ public class Main { final public static MetricRegistry metrics = new MetricRegistry(); - final public static String CREEPER_VERSION = "0.7 ALPHA"; + final public static String CREEPER_VERSION = getCreeperVersion(); final public static Set<Character> vowels = new HashSet<Character>(Arrays.asList('a', 'e', 'i', 'o', 'u')); + public static String getCreeperVersion() { + Properties props = new Properties(); + try { + props.load(Main.class.getResourceAsStream("resources/build.properties")); + } catch (IOException e) { + log.error("Problem reading build properties file.", e); + return "0"; + } + String someProperty = props.getProperty("build.version"); + return someProperty; + } public static void main(String[] args) throws Exception { CreeperConfiguration creeperConfiguration = new CreeperConfiguration(buildConfiguration(args)); diff --git a/src/main/resources/build.properties b/src/main/resources/build.properties new file mode 100644 index 0000000000000000000000000000000000000000..d3336e7dc825074bd1657348ca15054db88ca770 --- /dev/null +++ b/src/main/resources/build.properties @@ -0,0 +1 @@ +build.version=${buildNumber} \ No newline at end of file