igx
igx

Reputation: 4231

sbt assembly error deduplicate

Getting started with sbt. I am getting this error during sbt assembly

deduplicate: different file contents found in the following: ../.ivy2/cache/org.scalatest/scalatest_2.11/bundles/scalatest_2.11-2.2.6.jar:org/scalactic/SeqEqualityConstraints$.class ../.ivy2/cache/org.scalactic/scalactic_2.11/bundles/scalactic_2.11-3.0.0.jar:org/scalactic/SeqEqualityConstraints$.class

this is my build sbt :

scalaVersion  := "2.11.8"
scalacOptions := Seq("-unchecked", "-feature", "-deprecation", "-encoding", "utf8")

libraryDependencies ++= {
  val phantomV          = "1.29.5"
  val scalaTestV        = "2.2.6"
  val scalaMockV        = "3.4.2"
  val elastic4sV        = "2.4.0"
  val akkaStreamVersion = "2.4.10"
  val akkaVersion       = "2.3.12"
  Seq(
    "com.websudos"            %% "phantom-dsl"                        % phantomV,
    "com.websudos"            %% "phantom-reactivestreams"            % phantomV,
    "com.websudos"            %% "util-testing"                       % "0.13.0" % "test, provided",
    "com.typesafe.akka"       %% "akka-actor"                         % akkaVersion,
    "com.typesafe.akka"       %% "akka-http-spray-json-experimental"  % akkaStreamVersion,
    "com.typesafe.akka"       %% "akka-http-core"                     % akkaStreamVersion,
    "com.typesafe.akka"       %% "akka-http-experimental"             % akkaStreamVersion,
    "com.typesafe.akka"       %% "akka-http-testkit"                  % akkaStreamVersion,
    "com.typesafe.akka"       %% "akka-stream"                        % akkaStreamVersion,
    "com.typesafe.akka"       %% "akka-stream-testkit"                % akkaStreamVersion,
    "org.scalatest"           %% "scalatest"                          % scalaTestV  % "test, provided",
    "com.typesafe.akka"       %% "akka-testkit"                       % akkaVersion  % "test, provided",
    "com.typesafe.play"       %% "play-streams-experimental"          % "2.4.6"     % "provided",
    "com.sksamuel.elastic4s"  %% "elastic4s-core"                     % elastic4sV,
    "com.sksamuel.elastic4s"  %% "elastic4s-streams"                  % elastic4sV,
    "org.scalamock"           %% "scalamock-scalatest-support"        % scalaMockV % "test, provided",
    "com.typesafe"            % "config"                              % "1.3.1"

  )
}
lazy val root = project.in(file("."))
  .settings(mainClass in assembly := Some("com.ind.Main"))

initialCommands := """|import akka.actor._
                      |import akka.pattern._
                      |import akka.util._
                      |import scala.concurrent._
                      |import scala.concurrent.duration._""".stripMargin

fork in run := true
test in assembly := {}

any idea why am getting that and how can I solve it ?

===== UPDATE ==== I did managed to solve it by adding

assemblyMergeStrategy in assembly := {
  case PathList("META-INF", xs @ _*) => MergeStrategy.discard
  case x => MergeStrategy.first
}

Upvotes: 0

Views: 374

Answers (2)

Bill Venners
Bill Venners

Reputation: 3669

The ScalaTest and Scalactic version numbers need to match. You have a ScalaTest 2.2.6 trying to use a Scalactic 3.0.0, so that's the problem. One of your dependencies is perhaps using Scalactic 3.0.0.

Upvotes: 0

igx
igx

Reputation: 4231

assemblyMergeStrategy in assembly := {
  case PathList("META-INF", xs @ _*) => MergeStrategy.discard
  case x => MergeStrategy.first
}

Upvotes: 0

Related Questions