title: assembly-merge-strategy issues using sbt-assembly
body: <p>I am trying to convert a scala project into a deployable fat jar using <a href="https://github.com/sbt/sbt-assembly" rel="noreferrer">sbt-assembly</a>. When I run my assembly task in sbt I am getting the following error:</p>
  
  <pre><code>Merging 'org/apache/commons/logging/impl/SimpleLog.class' with strategy 'deduplicate'
      :assembly: deduplicate: different file contents found in the following:
      [error] /Users/home/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.1.1.jar:org/apache/commons/logging/impl/SimpleLog.class
      [error] /Users/home/.ivy2/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.6.4.jar:org/apache/commons/logging/impl/SimpleLog.class
  </code></pre>
  
  <p>Now from the sbt-assembly documentation:</p>
  
  <blockquote>
    <p>If multiple files share the same relative path (e.g. a resource named
        application.conf in multiple dependency JARs), the default strategy is
        to verify that all candidates have the same contents and error out
        otherwise. This behavior can be configured on a per-path basis using
        either one of the following built-in strategies or writing a custom one:</p>
    
    <ul>
    <li><code>MergeStrategy.deduplicate</code> is the default described above</li>
    <li><code>MergeStrategy.first</code> picks the first of the matching files in classpath order</li>
    <li><code>MergeStrategy.last</code> picks the last one</li>
    <li><code>MergeStrategy.singleOrError</code> bails out with an error message on conflict </li>
    <li><code>MergeStrategy.concat</code> simply concatenates all matching files and includes the result </li>
    <li><code>MergeStrategy.filterDistinctLines</code> also concatenates, but leaves out duplicates along the way</li>
    <li><code>MergeStrategy.rename</code> renames the files originating from jar files</li>
    <li><code>MergeStrategy.discard</code> simply discards matching files</li>
    </ul>
  </blockquote>
  
  <p>Going by this I setup my build.sbt as follows:</p>
  
  <pre><code>import sbt._
  import Keys._
  import sbtassembly.Plugin._
  import AssemblyKeys._
  name := "my-project"
  version := "0.1"
  scalaVersion := "2.9.2"
  crossScalaVersions := Seq("2.9.1","2.9.2")
  
  //assemblySettings
  seq(assemblySettings: _*)
  
  resolvers ++= Seq(
      "Typesafe Releases Repository" at "http://repo.typesafe.com/typesafe/releases/",
      "Typesafe Snapshots Repository" at "http://repo.typesafe.com/typesafe/snapshots/",
      "Sonatype Repository" at "http://oss.sonatype.org/content/repositories/releases/"
  )
  
  libraryDependencies ++= Seq(
      "org.scalatest" %% "scalatest" % "1.6.1" % "test",
      "org.clapper" %% "grizzled-slf4j" % "0.6.10",
      "org.scalaz" % "scalaz-core_2.9.2" % "7.0.0-M7",
      "net.databinder.dispatch" %% "dispatch-core" % "0.9.5"
  )
  
  scalacOptions += "-deprecation"
  mainClass in assembly := Some("com.my.main.class")
  test in assembly := {}
  mergeStrategy in assembly := mergeStrategy.first
  </code></pre>
  
  <p>In the last line of the build.sbt, I have:</p>
  
  <pre><code>mergeStrategy in assembly := mergeStrategy.first
  </code></pre>
  
  <p>Now, when I run SBT, I get the following error:</p>
  
  <pre><code>error: value first is not a member of sbt.SettingKey[String =&gt; sbtassembly.Plugin.MergeStrategy]
      mergeStrategy in assembly := mergeStrategy.first
  </code></pre>
  
  <p>Can somebody point out what I might be doing wrong here?</p>
  
  <p>Thanks</p>