dade
dade

Reputation: 3570

How do I modify the output directory of jar generated by sbt assembly

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?

Upvotes: 4

Views: 2255

Answers (1)

Eugene Yokota
Eugene Yokota

Reputation: 95654

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
  )

Upvotes: 4

Related Questions