title: SBT/Play2 multi-project setup does not include dependant projects in classpath in run/test
body: <p>I have following SBT/Play2 multi-project setup:</p>
  
  <pre><code>import sbt._
  import Keys._
  import PlayProject._
  
  object ApplicationBuild extends Build {
    val appName         = "traveltime-api"
    val appVersion      = "1.0"
  
    val appDependencies = Seq(
      // Google geocoding library
      "com.google.code.geocoder-java" % "geocoder-java" % "0.9",
      // Emailer
      "org.apache.commons" % "commons-email" % "1.2",
      // CSV generator
      "net.sf.opencsv" % "opencsv" % "2.0",
  
      "org.scalatest" %% "scalatest" % "1.7.2" % "test",
      "org.scalacheck" %% "scalacheck" % "1.10.0" % "test",
      "org.mockito" % "mockito-core" % "1.9.0" % "test"
    )
  
    val lib = RootProject(file("../lib"))
    val chiShape = RootProject(file("../chi-shape"))
  
    lazy val main = PlayProject(
      appName, appVersion, appDependencies, mainLang = SCALA
    ).settings(
      // Add your own project settings here
      resolvers ++= Seq(
        "Sonatype Snapshots" at
          "http://oss.sonatype.org/content/repositories/snapshots",
        "Sonatype Releases" at
          "http://oss.sonatype.org/content/repositories/releases"
      ),
      // Scalatest compatibility
      testOptions in Test := Nil
    ).aggregate(lib, chiShape).dependsOn(lib, chiShape)
  }
  </code></pre>
  
  <p>As you can see this project depends on two independant subprojects: lib and chiShape.</p>
  
  <p>Now compile works fine - all sources are correctly compiled. However if I try run or test, neither task in runtime has classes from subprojects on classpath loaded and things go haywire with NoClassFound exceptions.</p>
  
  <p>For example - my application has to load serialized data from file and it goes like this: test starts FakeApplication, it tries to load data and boom:</p>
  
  <pre><code>[info] CsvGeneratorsTest:
  [info] #markerFilterCsv 
  [info] - should fail on bad json *** FAILED ***
  [info]   java.lang.ClassNotFoundException: com.library.Node
  [info]   at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
  [info]   at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  [info]   at java.security.AccessController.doPrivileged(Native Method)
  [info]   at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  [info]   at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
  [info]   at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
  [info]   at java.lang.Class.forName0(Native Method)
  [info]   at java.lang.Class.forName(Class.java:264)
  [info]   at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:622)
  [info]   at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1593)
  [info]   ...
  </code></pre>
  
  <p>Strangely enough stage creates a directory structure with chi-shapes_2.9.1-1.0.jar and lib_2.9.1-1.0.jar in staged/.</p>
  
  <p>How can I get my runtime/test configurations get subprojects into classpath?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I've added following code to Global#onStart:</p>
  
  <pre><code>  override def onStart(app: Application) {
      println(app)
      ClassLoader.getSystemClassLoader.asInstanceOf[URLClassLoader].getURLs.
        foreach(println)
      throw new RuntimeException("foo!")
    }
  </code></pre>
  
  <p>When I launch tests, the classpath is very very ill populated, to say at least :)</p>
  
  <pre><code>FakeApplication(.,sbt.classpath.ClasspathUtilities$$anon$1@182253a,List(),List(),Map(application.load-data -&gt; test, mailer.smtp.test-mode -&gt; true))
  file:/home/arturas/Software/sdks/play-2.0.3/framework/sbt/sbt-launch.jar
  [info] CsvGeneratorsTest:
  </code></pre>
  
  <p>When launching staged app, there's a lot of stuff, how it's supposed to be :)</p>
  
  <pre><code>$ target/start
  Play server process ID is 29045
  play.api.Application@1c2862b
  file:/home/arturas/work/traveltime-api/api/target/staged/jul-to-slf4j.jar
  </code></pre>
  
  <p>That's strange, because there should be at least testing jars in the classpath I suppose?</p>