title: SBT Assembly - Deduplicate error & Exclude error
body: <p>I am trying to build a JAR with dependencies using sbt-assembly. But I am running into this error again and again. I have tried multiple different things but I end up here. I am pretty new to SBT and wanted to get some help on this one. Here are the build.sbt &amp; assembly.sbt files.</p>
  <p><strong>build.sbt</strong></p>
  <pre><code>seq(assemblySettings: _*)
  
  name := &quot;StreamTest&quot;
  
  version := &quot;1.0&quot;
  
  scalaVersion := &quot;2.10.4&quot;
  
  libraryDependencies += &quot;org.apache.spark&quot; %% &quot;spark-core&quot; % &quot;1.1.0&quot;
  
  libraryDependencies += &quot;org.apache.spark&quot; % &quot;spark-streaming-kinesis-asl_2.10&quot; % &quot;1.1.0&quot;
  </code></pre>
  <p><strong>project/assembly.sbt</strong></p>
  <pre><code>addSbtPlugin(&quot;com.eed3si9n&quot; % &quot;sbt-assembly&quot; % &quot;0.11.2&quot;)
  </code></pre>
  <p>When I run the sbt assembly command, I am getting this error below.</p>
  <pre><code>[info] Including: joda-time-2.5.jar
  [info] Checking every *.class/*.jar file's SHA-1.
  [info] Merging files...
  [warn] Merging 'about_files/LICENSE.txt' with strategy 'rename'
  [warn] Merging 'about_files/NOTICE.txt' with strategy 'rename'
  [warn] Merging 'META-INF/NOTICE.txt' with strategy 'rename'
  [warn] Merging 'META-INF/NOTICE' with strategy 'rename'
  [warn] Merging 'org/xerial/snappy/native/README' with strategy 'rename'
  [warn] Merging 'META-INF/maven/org.xerial.snappy/snappy-java/LICENSE' with strategy 'rename'
  [warn] Merging 'META-INF/license' with strategy 'rename'
  [warn] Merging 'about.html' with strategy 'rename'
  [warn] Merging 'META-INF/LICENSE.txt' with strategy 'rename'
  [warn] Merging 'META-INF/README.txt' with strategy 'rename'
  [warn] Merging 'LICENSE.txt' with strategy 'rename'
  [warn] Merging 'META-INF/LICENSE' with strategy 'rename'
  [warn] Merging 'META-INF/DEPENDENCIES' with strategy 'discard'
  java.lang.RuntimeException: deduplicate: different file contents found in the following:
  /Users/user/.ivy2/cache/org.eclipse.jetty.orbit/javax.transaction/orbits/javax.transaction-1.1.1.v201105210645.jar:META-INF/ECLIPSEF.RSA
  /Users/user/.ivy2/cache/org.eclipse.jetty.orbit/javax.servlet/orbits/javax.servlet-3.0.0.v201112011016.jar:META-INF/ECLIPSEF.RSA
  /Users/user/.ivy2/cache/org.eclipse.jetty.orbit/javax.mail.glassfish/orbits/javax.mail.glassfish-1.4.1.v201005082020.jar:META-INF/ECLIPSEF.RSA
  /Users/user/.ivy2/cache/org.eclipse.jetty.orbit/javax.activation/orbits/javax.activation-1.1.0.v201105071233.jar:META-INF/ECLIPSEF.RSA
      at sbtassembly.Plugin$Assembly$.sbtassembly$Plugin$Assembly$$applyStrategy$1(Plugin.scala:253)
      at sbtassembly.Plugin$Assembly$$anonfun$15.apply(Plugin.scala:270)
      at sbtassembly.Plugin$Assembly$$anonfun$15.apply(Plugin.scala:267)
      at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
      at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
      at scala.collection.Iterator$class.foreach(Iterator.scala:727)
      at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
      at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
      at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
      at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
      at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
      at sbtassembly.Plugin$Assembly$.applyStrategies(Plugin.scala:272)
      at sbtassembly.Plugin$Assembly$.x$4$lzycompute$1(Plugin.scala:172)
      at sbtassembly.Plugin$Assembly$.x$4$1(Plugin.scala:170)
      at sbtassembly.Plugin$Assembly$.stratMapping$lzycompute$1(Plugin.scala:170)
      at sbtassembly.Plugin$Assembly$.stratMapping$1(Plugin.scala:170)
      at sbtassembly.Plugin$Assembly$.inputs$lzycompute$1(Plugin.scala:214)
      at sbtassembly.Plugin$Assembly$.inputs$1(Plugin.scala:204)
      at sbtassembly.Plugin$Assembly$.apply(Plugin.scala:230)
      at sbtassembly.Plugin$Assembly$$anonfun$assemblyTask$1.apply(Plugin.scala:373)
      at sbtassembly.Plugin$Assembly$$anonfun$assemblyTask$1.apply(Plugin.scala:370)
      at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
      at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
      at sbt.std.Transform$$anon$4.work(System.scala:63)
      at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
      at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
      at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
      at sbt.Execute.work(Execute.scala:235)
      at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
      at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
      at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
      at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
  [error] (*:assembly) deduplicate: different file contents found in the following:
  [error] /Users/user/.ivy2/cache/org.eclipse.jetty.orbit/javax.transaction/orbits/javax.transaction-1.1.1.v201105210645.jar:META-INF/ECLIPSEF.RSA
  [error] /Users/user/.ivy2/cache/org.eclipse.jetty.orbit/javax.servlet/orbits/javax.servlet-3.0.0.v201112011016.jar:META-INF/ECLIPSEF.RSA
  [error] /Users/user/.ivy2/cache/org.eclipse.jetty.orbit/javax.mail.glassfish/orbits/javax.mail.glassfish-1.4.1.v201005082020.jar:META-INF/ECLIPSEF.RSA
  [error] /Users/user/.ivy2/cache/org.eclipse.jetty.orbit/javax.activation/orbits/javax.activation-1.1.0.v201105071233.jar:META-INF/ECLIPSEF.RSA
  [error] Total time: 23 s, completed Nov 28, 2014 9:32:53 PM
  </code></pre>
  <p><strong>sbt-version</strong></p>
  <pre><code>0.13.6
  </code></pre>
  <p><strong>EDIT</strong></p>
  <p>Now after looking around I have made another change to exclude any dependencies, as part of another question on stackoverflow.</p>
  <p><strong>Updated build.sbt</strong></p>
  <pre><code>seq(assemblySettings: _*)
  
  name := &quot;StreamTest&quot;
  
  version := &quot;1.0&quot;
  
  scalaVersion := &quot;2.10.4&quot;
  
  libraryDependencies += &quot;org.apache.spark&quot; %% &quot;spark-core&quot; % &quot;1.1.0&quot;
  
  libraryDependencies += &quot;org.apache.spark&quot; % &quot;spark-streaming-kinesis-asl_2.10&quot; % &quot;1.1.0&quot;
  
  libraryDependencies ++= Seq(
      exclude(&quot;org.eclipse.jetty.orbit&quot;, &quot;javax.servlet&quot;).
      exclude(&quot;org.eclipse.jetty.orbit&quot;, &quot;javax.transaction&quot;).
      exclude(&quot;org.eclipse.jetty.orbit&quot;, &quot;javax.mail&quot;).
      exclude(&quot;org.eclipse.jetty.orbit&quot;, &quot;javax.activation&quot;).
      exclude(&quot;commons-beanutils&quot;, &quot;commons-beanutils-core&quot;).
      exclude(&quot;commons-collections&quot;, &quot;commons-collections&quot;).
      exclude(&quot;commons-collections&quot;, &quot;commons-collections&quot;).
      exclude(&quot;com.esotericsoftware.minlog&quot;, &quot;minlog&quot;)
  )
  </code></pre>
  <p>When I run the assembly command again, this is the error that I get.</p>
  <pre><code>build.sbt:14: error: not found: value exclude
      exclude(&quot;org.eclipse.jetty.orbit&quot;, &quot;javax.servlet&quot;).
      ^
  </code></pre>
  <p>EDIT 2:</p>
  <p>Updated build.sbt</p>
  <pre><code>import AssemblyKeys._
  
  seq(assemblySettings: _*)
  
  name := &quot;SparkStreamingKinesis&quot;
  
  version := &quot;1.0&quot;
  
  scalaVersion := &quot;2.10.4&quot;
  
  libraryDependencies += &quot;org.apache.spark&quot; %% &quot;spark-core&quot; % &quot;1.1.0&quot;
  
  libraryDependencies += &quot;org.apache.spark&quot; % &quot;spark-streaming-kinesis-asl_2.10&quot; % &quot;1.1.0&quot;
  
  assemblyMergeStrategy in assembly := {
      case PathList(ps @ _*) if ps.last endsWith &quot;.RSA&quot; =&gt; MergeStrategy.first
      case x =&gt;
         val oldStrategy = (assemblyMergeStrategy in assembly).value
         oldStrategy(x)
  }
  </code></pre>
  <p>After making the update, here is the error that I am getting. I tried to do an import of assemblyMergeStrategy, but it doesn't look like a class that I can import.</p>
  <pre><code>build.sbt:21: error: not found: value assemblyMergeStrategy
  assemblyMergeStrategy in assembly := {
  ^
  [error] Type error in expression
  </code></pre>