SBT Assembly not working (not a valid command)
Pull 1 level up your build.sbt
. It should reside in project root, not it project
.
Also it's possible to have build.sbt
in project
folder as well, it means a different thing. Read Organizing Build document for some insight.
UPD: as @marios has suggested, can you also put resolvers to your build.sbt. Also, it's important to set SNAPSHOT version for your build. The whole content of your build.sbt
should be the following:
scalaVersion in ThisBuild := "2.11.7"
lazy val commonSettings = Seq(
organization := "com.example",
version := "0.1.0-SNAPSHOT"
)
lazy val app = (project in file(".")).
settings(commonSettings: _*).
settings(
name := "fat-jar-test"
).
enablePlugins(AssemblyPlugin)
resolvers in Global ++= Seq(
"Sbt plugins" at "https://dl.bintray.com/sbt/sbt-plugin-releases",
"Maven Central Server" at "http://repo1.maven.org/maven2",
"TypeSafe Repository Releases" at "http://repo.typesafe.com/typesafe/releases/",
"TypeSafe Repository Snapshots" at "http://repo.typesafe.com/typesafe/snapshots/"
)
Then, add two more files to root/project
folder:
root/project/build.properties
contains a single line:
sbt.version=0.13.7
root/project/plugins.sbt
also contains a single line:
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.12.0")
Now, remove your root/project/assembly.sbt
file (although it's fine to have it instead of plugins.sbt
, but let's just try - this configuration always works for me).
Now, your project layout should be the following:
root
|
build.sbt
src
project
|
plugins.sbt
build.properties
Reload sbt and try plugins
command. You should see sbtassembly.AssemblyPlugin
there.