6

I'm trying to use sbt-assembly and am having trouble getting it installed.

Verbatim from the readme I added the project/plugins.sbt with the dependency:

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.8.7")

Then I added a build.sbt file containing exactly what the readme said:

import AssemblyKeys._ // put this at the top of the file

assemblySettings

I get this error when launching sbt:

[error] /Users/me/git/stest/project/Build.scala:29: not found: value assemblySettings [error] .settings(assemblySettings: _*) [error] ^ [error] one error found [error] (compile:compile) Compilation failed

I went back and tried an alternate I saw in another stackoverflow post:

seq(assemblySettings:_*)

Same problem. Any ideas? (Scala 2.10.0)

Chris Seymour
  • 83,387
  • 30
  • 160
  • 202
Greg
  • 10,696
  • 22
  • 68
  • 98
  • I haven't tried what you're doing - do either of these links help: [xsbt plugins description](https://github.com/harrah/xsbt/wiki/Plugins) [scala-sbt plugins doc](http://www.scala-sbt.org/release/docs/Getting-Started/Using-Plugins) – n0741337 Apr 02 '13 at 16:00

1 Answers1

4

The author of the plugin here. You said you put exactly what build.sbt says, but the error is coming from build.scala. *.sbt file automatically imports several things, so you have to manually import them for build.scala.

For full configuration, see https://github.com/eed3si9n/sbt-assembly-full-config-sample/blob/master/project/builds.scala.

Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319
  • The app I am trying to convert to fat jar already uses Build derivative class, I added the options from your sample and got strange error in sbt, never seen anything like this: error] References to undefined settings: [error] [error] {.}/compile:this-project-ref from {.}/compile:unmanaged-classpath [error] [error] {.}/runtime:this-project-ref from {.}/runtime:internal-dependency-classpath [error] [error] {.}/compile:this-project-ref from {.}/compile:internal-dependency-classpath ..... and much more lines like this. I am quite new to Scala, any ideas what I am doing wrong? – kirhgoff Jul 01 '13 at 16:13
  • @kirhgoff: I ran into the same issue. How did you fix it? Thanks – shengmin Jan 26 '14 at 00:42