Just do not enable build settings in submodules that do not require this.
For example, using sbt 0.13.5 and sbt-assembly 0.11.2, here is a multi-module project. If you run assembly at the root, just the "app" project will be turned into a fat jar.
project/Build.scala
import sbt._ import Keys._ import sbtassembly.Plugin.assemblySettings object MyApp extends Build { lazy val root = Project("root", file(".")).aggregate(common, app) lazy val common = Project("common", file("common")) lazy val app = Project("app", file("app")).settings(assemblySettings: _*).dependsOn(common) }
common/src/main/scala/com/example/common/Hello.scala
package com.example.common object Hello { def hello(name: String): String = s"Hello, $name" }
app/src/main/scala/com/example/hello/App.scala
package com.example.hello import com.example.common.Hello._ object Main extends App { println(hello(args(0))) }
tobym
source share