我需要有两个不同的项目,比如说内部和外部,它们使用相同的数据层,并且出于干燥的原因,我想避免复制配置文件。
我查看了http://www.playframework.org/documentation/2.0.2/SBTSubProjects上的子项目文档,但文档很短。
感谢@Georg Engel,我现在知道模块化配置的可能性
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "MyApp"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
)
lazy val common = Project(appName + "-common", file("modules/common"))
lazy val website = PlayProject(
appName + "-website", appVersion, path = file("modules/website")
).dependsOn(common)
lazy val adminArea = PlayProject(
appName + "-admin", appVersion, path = file("modules/admin")
).dependsOn(common)
lazy val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
// Add your own project settings here
).dependsOn(
website, adminArea
)
}
以及我遇到的编译错误仅是由于反向路由器(取消路由但不是控制器操作导致此)