3

I am using sbt-assembly to create an executable jar.

I was wondering, how do I modify the output directory of jar generated by sbt assembly?

By default, the generated jar is in /path/target/scala-2.11/. I want to change this to not include the scala version, that is, have the generated jar be in /path/target/ instead.

How to go about this?

dade
  • 3,340
  • 4
  • 32
  • 53

1 Answers1

3

You can change target in assembly setting as follows:

lazy val root = (project in file(".")).
  settings(
    inThisBuild(List(
      scalaVersion := "2.11.8",
      organization := "com.example"
    )),
    name := "hello-world",
    target in assembly := target.value
  )
Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319
  • 2
    I don't understand. What will be the output directory in your example? EDIT:Oh okay, I got it. Settings `target in assembly := file("outputdir")` – aclowkay Jul 25 '17 at 07:11