Play Framework as SBT Non-Root Module

I am attempting to develop a Play 2.0 web application alongside a core Java module and other Java clients using SBT. Is it possible to configure this in a way where the Play application is still built properly?

I have developed a small one-off Play 2.0 app before but I have zero experience working with SBT directly. So far I have come up with the following directory structure and project/Build.scala file.

 |    |---app/
 |    |---conf/
 |    |---public/


object ApplicationBuild extends Build {

    val appVersion      = "1.0-SNAPSHOT"

    val appDependencies = Seq(
      // Add your project dependencies here,

    val common  = Project("hi-common", file("common"))

    val client1 = Project("hi-client1", file("client1")).dependsOn(common)

    val client2 = Project("hi-client2", file("client2")).dependsOn(common)

    val webapp = PlayProject("hi-webapp", appVersion, appDependencies, path = file("webapp"),  mainLang = JAVA).settings(
        // Add your own project settings here      

    val root = Project("hi", file(".")).aggregate(client1, client2, webapp)


Running sbt clean package seems to work appropriately for the common, client1, and client2 modules but the webapp module is not packaged to a point where I can run webapp/target/start.

What can I do to achieve this as a single build with proper output?


The problem here is that simply running the package goal is not enough to generate a start script for you. It will assemble the fully package web application but without a single means of starting it.

My goal was the deployment to Heroku who conveniently provide a plugin which will generate this start script for you. The repository for the plugin's inclusion is added by default with a Play 2.0 web application so all you have to do is modify the commands that you are using for the build to sbt clean compile stage and you will find an start script in the webapp/target/ folder.

Need Your Help

Retrieving frame source code with a Java HTML Parser?

java html-parsing

I looked through some Java HtmlParser ( Jericho, HtmlCLeaner, ... ) but I couldn't find a feature that when retreiving a page would replace the html frame tag with the actual source code .