diff --git a/thresh/pom.xml b/thresh/pom.xml
index b8d6268..acdaf8b 100644
--- a/thresh/pom.xml
+++ b/thresh/pom.xml
@@ -21,6 +21,8 @@
false
UTF-8
UTF-8
+ ${maven.build.timestamp}
+ yyyy-MM-dd'T'HH:mm:ss
${project.artifactId}-${project.version}-${timestamp}-${buildNumber}
${project.artifactId}-${project.version}-shaded
@@ -200,6 +202,21 @@
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.4
+
+
+
+ monasca.thresh
+
+
+ ${artifactNamedVersion}
+
+
+
+
org.apache.maven.plugins
maven-shade-plugin
diff --git a/thresh/src/main/java/monasca/thresh/ThresholdingEngine.java b/thresh/src/main/java/monasca/thresh/ThresholdingEngine.java
index 1defe27..8095014 100644
--- a/thresh/src/main/java/monasca/thresh/ThresholdingEngine.java
+++ b/thresh/src/main/java/monasca/thresh/ThresholdingEngine.java
@@ -59,8 +59,20 @@ public class ThresholdingEngine {
public static void main(String... args) throws Exception {
+ /*
+ * This should allow command line options to show the current version java
+ * -jar monasca-thresh.jar --version java -jar monasca-thresh.jar -version
+ * java -jar monasca-thresh.jar version Really anything with the word
+ * version in it will show the version as long as there is only one argument
+ */
+ if (args.length == 1 && args[0].toLowerCase().contains("version")) {
+ showVersion();
+ System.exit(0);
+ }
+
// Let's show the logging status.
StatusPrinter.print((LoggerContext) LoggerFactory.getILoggerFactory());
+ showVersion();
if (args.length < 2) {
logger.error("Expected configuration file name and topology name arguments");
@@ -76,6 +88,14 @@ public class ThresholdingEngine {
engine.run();
}
+ private static void showVersion() {
+ Package pkg;
+ pkg = Package.getPackage("monasca.thresh");
+
+ logger.info("-------- Version Information --------");
+ logger.info("{}", pkg.getImplementationVersion());
+ }
+
protected void configure() {
Injector.registerModules(new TopologyModule(threshConfig));
}