14
votes

I'm installing Sbt-Assembly, but am now stuck.

Sbt Version (from 'sbt about'): 0.13.8
Current project is built against scala 2.11.6
Sbt, sbt plugins, and build definitions are using Scala 2.10.4

project/assembly.sbt

   addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.0")
   resolvers += Resolver.url("bintray-sbt-plugins", url("http://dl.bintray.com/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)

build.sbt

   scalaVersion in ThisBuild := "2.11.6"

~/.sbt/0.13/global.sbt

   scalaVersion := "2.11.6"

I realize sbt-assembly is for scala 2.10. If I change my project to scala 2.10, I have new unavailable dependencies for 2.10 which is not desirable. Is there a way to configure my project to use 2.10 just for the assembly plugin?

  ==== bintray-sbt-plugins: tried
  http://dl.bintray.com/sbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_2.11/sbt_0.13/0.14.0/ivys/ivy.xml

  ::::::::::::::::::::::::::::::::::::::::::::::
  ::          UNRESOLVED DEPENDENCIES         ::
  ::::::::::::::::::::::::::::::::::::::::::::::
  :: com.eed3si9n#sbt-assembly;0.14.0: not found
  ::::::::::::::::::::::::::::::::::::::::::::::

  Note: Some unresolved dependencies have extra attributes.  
  Check that these dependencies exist with the requested attributes.

      com.eed3si9n:sbt-assembly:0.14.0 (scalaVersion=2.11, sbtVersion=0.13)
4

4 Answers

10
votes

Just remove scalaVersion from global.sbt.

Because SBT is recursive it uses this scalaVersion from global.sbt when building your build files, which fails because SBT 0.13 is built with Scala 2.10, and so are all SBT plugins.

4
votes

I had a similar problem, what helped was adding addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3") to the project/plugins.sbt instead of plugins.sbt in the root directory of my project.

2
votes

I had a similar error. Changing sbt-assembly version (from 0.14.3 to 0.14.5) worked. My sbt version was 1.0.3 and I used : addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")

1
votes

Just don't use sbt-assembly at all! :) Flat-jars cause conflicts during merging which need to be resolved with assemblyMergeStrategy. Use the binary distribution format plugin that sbt offers which enables you to distribute in binary script, dmg, msi and tar.gz.

Check out sbt-native-packager