scala - Scoping unmanaged dependencies library sbt-assembly -
i'm trying scope unmanaged dependencies libararies main project. here scenario
i have unamanaged dependency in lib
folder called coinprism-api-assembly-1.2.jar
has following build.scala
file:
1 import sbt._ 2 import keys._ 3 object coinprismbuild extends build { 4 5 val appname = "coinprism-api" 6 val appv = "1.2" 7 val scalav = "2.11.2" 8 val akkav = "2.3.6" 9 val sprayv = "1.3.2" 10 11 val appdependencies = seq( 12 "com.typesafe.akka" %% "akka-actor" % akkav withsources() withjavadoc(), 13 "com.typesafe.akka" %% "akka-testkit" % akkav % "test" withsources() withjavadoc(), 14 "io.spray" %% "spray-client" % sprayv withsources() withjavadoc(), 15 "io.spray" %% "spray-can" % sprayv withsources() withjavadoc(), 16 "io.spray" %% "spray-routing" % sprayv withsources() withjavadoc(), 17 "io.spray" %% "spray-json" % "1.3.1" withsources() withjavadoc(), 18 "io.spray" %% "spray-testkit" % sprayv % "test" withsources() withjavadoc(), 19 "org.scalatest" %% "scalatest" % "2.2.4" % "test" withsources() withjavadoc(), 20 "joda-time" % "joda-time" % "2.7" 21 ) 22 23 24 lazy val root = project(appname, base=file(".")).settings( 25 scalaversion := scalav, 26 version := appv, 27 librarydependencies ++= appdependencies 28 ) 29 30 }
the project trying assemble has following build.sbt
file:
import assemblykeys._ name := "suredbits-core" version := "2.13.0" scalaversion := "2.11.4" resolvers += resolver.mavenlocal organization := "com.suredbits.core" librarydependencies ++= { val sprayv = "1.3.2" val akkav = "2.3.8" seq( "org.scalatest" % "scalatest_2.11" % "2.2.0", "io.spray" %% "spray-can" % sprayv % "provided" withsources() withjavadoc(), "io.spray" %% "spray-routing" % sprayv % "provided" withsources() withjavadoc(), "io.spray" %% "spray-testkit" % sprayv % "test" withsources() withjavadoc(), "com.typesafe.akka" %% "akka-actor" % akkav % "provided" withsources() withjavadoc(), "com.typesafe.akka" %% "akka-testkit" % akkav % "test" withsources() withjavadoc(), "org.specs2" %% "specs2-core" % "2.4.7-scalaz-7.0.6" % "test" withsources() withjavadoc(), "org.scalactic" %% "scalactic" % "2.2.1" % "test" withsources() withjavadoc(), "io.spray" %% "spray-json" % "1.3.0" withsources() withjavadoc(), "info.blockchain" % "api" % "1.0.1", "com.github.nscala-time" %% "nscala-time" % "1.6.0" withsources() withjavadoc() , "com.typesafe.slick" %% "slick" % "2.1.0" withsources() withjavadoc(), "com.typesafe.slick" %% "slick-testkit" % "2.1.0" % "test" withsources() withjavadoc(), "com.novocode" % "junit-interface" % "0.10" % "test" withsources() withjavadoc(), "postgresql" % "postgresql" % "9.1-901.jdbc4" % "test" withsources() withjavadoc(), "org.postgresql" % "postgresql" % "9.2-1003-jdbc4" withsources() withjavadoc(), "org.bitcoinj" % "bitcoinj-core" % "0.12" withsources() withjavadoc() , "org.slf4j" % "slf4j-api" % "1.7.5", "org.slf4j" % "slf4j-simple" % "1.7.5" ) } testoptions += tests.argument(testframeworks.junit, "-q", "-v", "-s", "-a") parallelexecution in test := false logbuffered := false scalacoptions ++= seq("-unchecked", "-deprecation", "-feature") scalacoptions ++= seq("-xmax-classfile-name", "255") scalacoptions in (compile,doc) ++= seq("-groups", "-implicits")
here error message getting after switching sbt-assembly
version 0.11.2
.
java.lang.runtimeexception: deduplicate: different file contents found in following: /home/chris/dev/suredbits-core/lib/coinprism-api-assembly-1.2.jar:scala-xml.properties /home/chris/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.1.jar:scala-xml.properties @ sbtassembly.plugin$assembly$.sbtassembly$plugin$assembly$$applystrategy$1(plugin.scala:253) @ sbtassembly.plugin$assembly$$anonfun$15.apply(plugin.scala:270) @ sbtassembly.plugin$assembly$$anonfun$15.apply(plugin.scala:267) @ scala.collection.traversablelike$$anonfun$flatmap$1.apply(traversablelike.scala:251) @ scala.collection.traversablelike$$anonfun$flatmap$1.apply(traversablelike.scala:251) @ scala.collection.iterator$class.foreach(iterator.scala:727) @ scala.collection.abstractiterator.foreach(iterator.scala:1157) @ scala.collection.iterablelike$class.foreach(iterablelike.scala:72) @ scala.collection.abstractiterable.foreach(iterable.scala:54) @ scala.collection.traversablelike$class.flatmap(traversablelike.scala:251) @ scala.collection.abstracttraversable.flatmap(traversable.scala:105) @ sbtassembly.plugin$assembly$.applystrategies(plugin.scala:272) @ sbtassembly.plugin$assembly$.x$4$lzycompute$1(plugin.scala:172) @ sbtassembly.plugin$assembly$.x$4$1(plugin.scala:170) @ sbtassembly.plugin$assembly$.stratmapping$lzycompute$1(plugin.scala:170) @ sbtassembly.plugin$assembly$.stratmapping$1(plugin.scala:170) @ sbtassembly.plugin$assembly$.inputs$lzycompute$1(plugin.scala:214) @ sbtassembly.plugin$assembly$.inputs$1(plugin.scala:204) @ sbtassembly.plugin$assembly$.apply(plugin.scala:230) @ sbtassembly.plugin$assembly$$anonfun$assemblytask$1.apply(plugin.scala:373) @ sbtassembly.plugin$assembly$$anonfun$assemblytask$1.apply(plugin.scala:370) @ scala.function1$$anonfun$compose$1.apply(function1.scala:47) @ sbt.$tilde$greater$$anonfun$$u2219$1.apply(typefunctions.scala:40) @ sbt.std.transform$$anon$4.work(system.scala:63) @ sbt.execute$$anonfun$submit$1$$anonfun$apply$1.apply(execute.scala:226) @ sbt.execute$$anonfun$submit$1$$anonfun$apply$1.apply(execute.scala:226) @ sbt.errorhandling$.wideconvert(errorhandling.scala:17) @ sbt.execute.work(execute.scala:235) @ sbt.execute$$anonfun$submit$1.apply(execute.scala:226) @ sbt.execute$$anonfun$submit$1.apply(execute.scala:226) @ sbt.concurrentrestrictions$$anon$4$$anonfun$1.apply(concurrentrestrictions.scala:159) @ sbt.completionservice$$anon$2.call(completionservice.scala:28) @ java.util.concurrent.futuretask.run(futuretask.java:262) @ java.util.concurrent.executors$runnableadapter.call(executors.java:471) @ java.util.concurrent.futuretask.run(futuretask.java:262) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:745) [error] (*:assembly) deduplicate: different file contents found in following: [error] /home/chris/dev/suredbits-core/lib/coinprism-api-assembly-1.2.jar:scala-xml.properties [error] /home/chris/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.1.jar:scala-xml.properties [error] total time: 72 s, completed mar 21, 2015 11:22:24
so how exclude dependencies in coin-prism-api
jar conflicing jars inside of suredbits-core
?
from understand 1 of libraries include contains "xml" scala library , in project use library (directly or through dependency)
everything should fine except use 2 different versions of library. version of library should sbt-assembly use? if chooses 1 version module using other version won't work.
in jar can't have 2 different versions of same library.
Comments
Post a Comment