I want to test how sub projects work, especially how the routes
of the sub project are taken into account in main project (this was not visible before).
I h
Finally got it working:
Build.scala
from the subproject.You need to rename the routes file of your sub project. In my example, to subProject.routes
. If you want to run your subproject in isolation you need to declare that routes must resolve to your subProject.routes. So add this in the application.conf
of your subProject:
application.router=subProject.Routes
In your main project, you need to import the routes from the subproject:
-> /subProject subProject.Routes
And the build file of the main project should look something like: example is from SCALA but s
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "MainProject"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
javaCore,
javaJdbc,
javaEbean
)
val subProject = play.Project(
appName + "-subProject", appVersion, path = file("modules/SubProject")
)
val main = play.Project(appName, appVersion, appDependencies).settings(
// Add your own project settings here
).dependsOn(subProject)
}