diff --git a/core/pom.xml b/core/pom.xml index be71176e2fd79a78b3534e014650d853fed8054a..e914c5c04b996deee017a0dc151cdf13e44f53e6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -57,6 +57,12 @@ LICENSE file. </dependency> </dependencies> <build> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/core/src/main/java/com/yahoo/ycsb/Client.java b/core/src/main/java/com/yahoo/ycsb/Client.java index 73f1eaa91388b1188dd9de0e09fe0f7c4beb26bd..d64772564d81e90e5daee589ef8fc9ba28ca8d7b 100644 --- a/core/src/main/java/com/yahoo/ycsb/Client.java +++ b/core/src/main/java/com/yahoo/ycsb/Client.java @@ -771,16 +771,7 @@ public class Client double targetperthread=((double)target)/((double)threadcount); targetperthreadperms=targetperthread/1000.0; } - - System.out.println("YCSB Client 0.1"); - System.out.print("Command line:"); - for (int i=0; i<args.length; i++) - { - System.out.print(" "+args[i]); - } - System.out.println(); - System.err.println("Loading workload..."); - + //show a warning message that creating the workload is taking a while //but only do so if it is taking longer than 2 seconds //(showing the message right away if the setup wasn't taking very long was confusing people) @@ -809,6 +800,22 @@ public class Client //load the workload ClassLoader classLoader = Client.class.getClassLoader(); + try { + Properties projectProp = new Properties(); + projectProp.load(classLoader.getResourceAsStream("project.properties")); + System.err.println("YCSB Client " + projectProp.getProperty("version")); + } catch (IOException e) { + System.err.println("Unable to retrieve client version."); + } + + System.err.print("Command line:"); + for (int i=0; i<args.length; i++) + { + System.err.print(" "+args[i]); + } + System.err.println(); + System.err.println("Loading workload..."); + Workload workload=null; try diff --git a/core/src/main/resources/project.properties b/core/src/main/resources/project.properties new file mode 100644 index 0000000000000000000000000000000000000000..defbd48204e4784090fe0e17e28fe5bc395abf47 --- /dev/null +++ b/core/src/main/resources/project.properties @@ -0,0 +1 @@ +version=${project.version}