[GEARPUMP-259] fix integration test

Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

 - [x] Make sure the commit message is formatted like:
   `[GEARPUMP-<Jira issue #>] Meaningful description of pull request`
 - [ ] Make sure tests pass via `sbt clean test`.
 - [x] Make sure old documentation affected by the pull request has been updated and new documentation added for new functionality.

Author: huafengw <fvunicorn@gmail.com>

Closes #129 from huafengw/fix259.
diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/TestSpecBase.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/TestSpecBase.scala
index 1e49236..a00495a 100644
--- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/TestSpecBase.scala
+++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/TestSpecBase.scala
@@ -51,7 +51,7 @@
   lazy val commandLineClient = cluster.commandLineClient
   lazy val restClient = cluster.restClient
 
-  lazy val wordCountJar = cluster.queryBuiltInExampleJars("wordcount-").head
+  lazy val wordCountJar = cluster.queryBuiltInExampleJars("wordcount_").head
   lazy val wordCountName = "wordCount"
   lazy val wordCountClass = "org.apache.gearpump.streaming.examples.wordcount.WordCount"
 
diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/CommandLineSpec.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/CommandLineSpec.scala
index f4e463e..3fa6f6a 100644
--- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/CommandLineSpec.scala
+++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/CommandLineSpec.scala
@@ -90,7 +90,7 @@
       // setup
       val args = "-debug true -sleep 10"
       val appId = expectSubmitAppSuccess(wordCountJar, args)
-      var success = commandLineClient.killApp(appId)
+      val success = commandLineClient.killApp(appId)
       success shouldBe true
     }
 
diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ConnectorKafkaSpec.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ConnectorKafkaSpec.scala
index d8bdc1e..e69a425 100644
--- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ConnectorKafkaSpec.scala
+++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ConnectorKafkaSpec.scala
@@ -28,7 +28,7 @@
 class ConnectorKafkaSpec extends TestSpecBase {
 
   private lazy val kafkaCluster = new KafkaCluster(cluster.getNetworkGateway)
-  private lazy val kafkaJar = cluster.queryBuiltInExampleJars("kafka-").head
+  private lazy val kafkaJar = cluster.queryBuiltInExampleJars("kafka").head
   private var producer: NumericalDataProducer = null
 
   override def beforeAll(): Unit = {
diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/DynamicDagSpec.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/DynamicDagSpec.scala
index a1d1162..c4276bd 100644
--- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/DynamicDagSpec.scala
+++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/DynamicDagSpec.scala
@@ -26,7 +26,7 @@
 
   val sourceTaskClass = "org.apache.gearpump.streaming.examples.sol.SOLStreamProducer"
   val sinkTaskClass = "org.apache.gearpump.streaming.examples.sol.SOLStreamProcessor"
-  lazy val solJar = cluster.queryBuiltInExampleJars("sol-").head
+  lazy val solJar = cluster.queryBuiltInExampleJars("sol").head
 
   "dynamic dag" should {
     "can retrieve a list of built-in partitioner classes" in {
diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ExampleSpec.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ExampleSpec.scala
index 5554a26..97d5daf 100644
--- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ExampleSpec.scala
+++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/ExampleSpec.scala
@@ -32,7 +32,7 @@
 
   "distributed shell" should {
     "execute commands on machines where its executors are running" in {
-      val distShellJar = cluster.queryBuiltInExampleJars("distributedshell-").head
+      val distShellJar = cluster.queryBuiltInExampleJars("distributedshell").head
       val mainClass = "org.apache.gearpump.examples.distributedshell.DistributedShell"
       val clientClass = "org.apache.gearpump.examples.distributedshell.DistributedShellClient"
       val appId = restClient.getNextAvailableAppId()
@@ -61,7 +61,7 @@
   }
 
   "wordcount" should {
-    val wordCountJarNamePrefix = "wordcount-"
+    val wordCountJarNamePrefix = "wordcount_"
     behave like streamingApplication(wordCountJarNamePrefix, wordCountName)
 
     "can submit immediately after killing a former one" in {
@@ -84,19 +84,19 @@
   }
 
   "wordcount(java)" should {
-    val wordCountJavaJarNamePrefix = "wordcountjava-"
+    val wordCountJavaJarNamePrefix = "wordcountjava"
     val wordCountJavaName = "wordcountJava"
     behave like streamingApplication(wordCountJavaJarNamePrefix, wordCountJavaName)
   }
 
   "sol" should {
-    val solJarNamePrefix = "sol-"
+    val solJarNamePrefix = "sol"
     val solName = "sol"
     behave like streamingApplication(solJarNamePrefix, solName)
   }
 
   "complexdag" should {
-    val dynamicDagJarNamePrefix = "complexdag-"
+    val dynamicDagJarNamePrefix = "complexdag"
     val dynamicDagName = "dag"
     behave like streamingApplication(dynamicDagJarNamePrefix, dynamicDagName)
   }
diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/MessageDeliverySpec.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/MessageDeliverySpec.scala
index bb9982a..9186364 100644
--- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/MessageDeliverySpec.scala
+++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/MessageDeliverySpec.scala
@@ -64,7 +64,7 @@
               "-sourceTask", sourcePartitionNum).mkString(" ")
             val appId = restClient.getNextAvailableAppId()
 
-            val stateJar = cluster.queryBuiltInExampleJars("state-").head
+            val stateJar = cluster.queryBuiltInExampleJars("state").head
             val success = restClient.submitApp(stateJar, executorNum = 1, args = args)
             success shouldBe true
 
diff --git a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/StormCompatibilitySpec.scala b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/StormCompatibilitySpec.scala
index b327bf4..7c04cc0 100644
--- a/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/StormCompatibilitySpec.scala
+++ b/integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/checklist/StormCompatibilitySpec.scala
@@ -53,7 +53,7 @@
   }
 
   def getStormJar(stormVersion: String): String = {
-    cluster.queryBuiltInITJars(s"storm$stormVersion-").head
+    cluster.queryBuiltInITJars(s"storm$stormVersion").head
   }
 
   "Storm over Gearpump" should withStorm {
@@ -168,11 +168,10 @@
                 s"executor $executorToKill killed")
 
               // verify no message loss
-              val detector = new
-                  MessageLossDetector(producer.lastWriteNum)
-              val kafkaReader = new
-                  SimpleKafkaReader(detector, sinkTopic, host = kafkaCluster.advertisedHost,
-                    port = kafkaCluster.advertisedPort)
+              val detector = new MessageLossDetector(producer.lastWriteNum)
+              val kafkaReader =
+                new SimpleKafkaReader(detector, sinkTopic, host = kafkaCluster.advertisedHost,
+                  port = kafkaCluster.advertisedPort)
 
               Util.retryUntil(() => {
                 kafkaReader.read()
diff --git a/project/BuildExamples.scala b/project/BuildExamples.scala
index 5507f00..2af19ba 100644
--- a/project/BuildExamples.scala
+++ b/project/BuildExamples.scala
@@ -102,23 +102,30 @@
   lazy val distributedshell = Project(
     id = "gearpump-examples-distributedshell",
     base = file("examples/distributedshell"),
-    settings = exampleSettings("org.apache.gearpump.examples.distributedshell.DistributedShell")
+    settings = commonSettings ++ noPublish ++ myAssemblySettings ++ Seq(
+      mainClass in(Compile, packageBin) :=
+        Some("org.apache.gearpump.examples.distributedshell.DistributedShell"),
+      target in assembly := baseDirectory.value.getParentFile / "target" /
+        CrossVersion.binaryScalaVersion(scalaVersion.value)
+    )
   ).dependsOn(core % "test->test; provided")
 
   lazy val distributeservice = Project(
     id = "gearpump-examples-distributeservice",
     base = file("examples/distributeservice"),
-    settings =
-      exampleSettings("org.apache.gearpump.experiments.distributeservice.DistributeService") ++
-        Seq(
-          libraryDependencies ++= Seq(
-            "commons-httpclient" % "commons-httpclient" % commonsHttpVersion,
-            "commons-lang" % "commons-lang" % commonsLangVersion,
-            "commons-io" % "commons-io" % commonsIOVersion,
-            "io.spray" %% "spray-can" % sprayVersion,
-            "io.spray" %% "spray-routing-shapeless2" % sprayVersion
-          )
+    settings = commonSettings ++ noPublish ++ myAssemblySettings ++ Seq(
+      mainClass in(Compile, packageBin) :=
+        Some("org.apache.gearpump.experiments.distributeservice.DistributeService"),
+      target in assembly := baseDirectory.value.getParentFile / "target" /
+        CrossVersion.binaryScalaVersion(scalaVersion.value),
+      libraryDependencies ++= Seq(
+        "commons-httpclient" % "commons-httpclient" % commonsHttpVersion,
+        "commons-lang" % "commons-lang" % commonsLangVersion,
+        "commons-io" % "commons-io" % commonsIOVersion,
+        "io.spray" %% "spray-can" % sprayVersion,
+        "io.spray" %% "spray-routing-shapeless2" % sprayVersion
         )
+    )
   ).dependsOn(core % "test->test; provided")
 
   lazy val fsio = Project(
diff --git a/project/BuildExperiments.scala b/project/BuildExperiments.scala
index 550b407..e07b688 100644
--- a/project/BuildExperiments.scala
+++ b/project/BuildExperiments.scala
@@ -88,7 +88,6 @@
             exclude("clout", "clout")
             exclude("compojure", "compojure")
             exclude("hiccup", "hiccup")
-            exclude("javax.servlet", "servlet-api")
             exclude("jline", "jline")
             exclude("joda-time", "joda-time")
             exclude("org.clojure", "core.incubator")