Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sbt assembly command not found

I'm trying to run sbt assembly. According to https://github.com/sbt/sbt-assembly , for sbt 0.13.6+ (I'm on 0.13.7) this should be included automatically for anything with the JvmPlugin. According to sbt plugins I have the JvmPlugin enabled in root. When I run sbt assembly I get "Not a valid commamdn: assembly". I've tried using old methods of including sbt-assembly with all the different types of sbt configurations, but none seem to work. Here's what my build files look like (note sbt package works fine)

assembly.sbt

addSbtPlugin("com.eed3si8n" % "sbt-assembly" % "0.13.0")

build.sbt

lazy val commonSettings = Seq(   organization := "com.test",   version := "1.0",   scalaVersion := "2.10.4" )  lazy val root = (project in file(".")).   settings(commonSettings: _*).   settings(     name := "test",      resolvers ++= Seq(       ...     ),      libraryDependencies ++= Seq(       ...     ) ) 

Here is the error:

[error] Not a valid command: assembly [error] Not a valid project ID: assembly [error] Expected ':' (if selecting a configuration) [error] Not a valid key: assembly [error] assembly [error]      

Any ideas? Running on Linux. Thanks

like image 480
Jonathan Sweetman Avatar asked Apr 08 '15 19:04

Jonathan Sweetman


People also ask

What does SBT Assembly do?

The sbt-assembly plugin is an SBT plugin for building a single independent fat JAR file with all dependencies included. This is inspired by the popular Maven assembly plugin, which is used to build fat JARs in Maven.


1 Answers

Did you create a assembly.sbt at the root of your project? Alongside your build.sbt?

If so, then that's the problem. You want to have it inside the project directory.

Having done that it worked out the box as expected with the rest of your setup:

> assembly [info] Including: scala-library.jar [info] Checking every *.class/*.jar file's SHA-1. [info] Merging files... [warn] Merging 'META-INF/MANIFEST.MF' with strategy 'discard' [warn] Strategy 'discard' was applied to a file [info] SHA-1: 1ae0d7a9c433e439e81ce947659bf05aa62a2892 [info] Packaging /Users/dnw/Desktop/t-2015-04-08.2340/target/scala-2.10/test-assembly-1.0.jar ... [info] Done packaging. [success] Total time: 2 s, completed 08-Apr-2015 23:45:59 
like image 165
Dale Wijnand Avatar answered Oct 14 '22 04:10

Dale Wijnand