title: How to use sbt native packager with subprojects (sbt 0.13)
body: <p>I have an sbt project with a multitude of subprojects and external library dependencies. <code>build.sbt</code> goes like this:</p>
  
  <pre><code>val extlib1 = "xy.xxx" % "lib1" % "1.0+"
  val extlib2 = "xy.yyy" % "lib2" % "1.0+"
  val extlib3 = "xy.zzz" % "lib3" % "1.0+"
  
  lazy val core=project settings (
    name:="cor",
    libraryDependencies++=Seq(extlib1)
  )
  
  lazy val servercore=project settings (
    name:="srvcore",
    libraryDependencies++=Seq(extlib1,extlib2)
  ) dependsOn(core)
  
  lazy val masterserver=project settings (
    name:="mastersrv",
    mainClass:=Some("masterserver")
  ) dependsOn(servercore)
  
  lazy val otherserver=project settings (
    name:="othersrv",
    libraryDependencies++=Seq(extlib3),
    mainClass:=Some("otherserver")
  ) dependsOn(servercore)
  
  // Only for aggregating the builds of the subprojects
  lazy val root=project in file(".") settings(name:="proj") aggregate(
    core,servercore,masterserver,otherserver
  )
  </code></pre>
  
  <p>So actually the project creates several programs ("masterserver", "otherserver") which depend on external libraries and a subset of the subprojects of this project itself.</p>
  
  <p>What I want to have is a complete set of JARs needed to start the master server or the other server, <em>seperated for each</em>. So, I'd like to have e.g. <code>masterserver/target/&lt;whatever&gt;</code> containing</p>
  
  <pre><code>mastersrv.jar
  srvcore.jar   (needed by mastersrv.jar)
  cor.jar       (needed by srvcore.jar)
  lib1.jar      (needed by mastersrv and srvcore)
  lib2.jar      (needed by srvcore)
  &lt;whatever&gt;.jar  (further libs needed by lib1 or lib2)
  </code></pre>
  
  <p>and a <code>otherserver/target/&lt;whatever&gt;</code> with similar content (it would have to add <code>lib3.jar</code> also, as that is needed by <code>othersrv.jar</code>.</p>
  
  <p>How to do that? Can I perform this with the native packager? Issuing <code>stage</code> in the root project does nothing (because there is no <code>mailClass</code>?). Issuing <code>masterserver/state</code> gives an error message</p>
  
  <pre><code>&gt; masterserver/stage
  [error] No such setting/task
  [error] masterserver/stage
  [error]                   ^
  </code></pre>
  
  <p>I must admit that I do not get a real clue out of the native packager plugin documentation. How can I archive what I want to have?</p>
  
  <p>Edit: Of course, I am not bound to the directory stuff. If I get multiple ZIP files in the main <code>target</code> directory, it's o.k., too. I only want to have all dependencies of a subproject at one location.</p>
  
  <p>Edit 2: Ok, I learned that the Play! framework does exactly what I want. And it uses the sbt native packager for it. How can I archieve a recursive universal packaging of subprojects in non-Play sbt-handled projects which use Java as programming language?</p>