0
我試圖在播放框架中使用SBT子項目,並按照說明here。Play Framework 2.1.1在多項目設置中無法找到播放對象Build.scala
我創建了三個目錄,一個包含主要播放內容,一個目錄是sbt子項目,最後一個是帶有Build.scala文件的項目目錄。
起初我遇到了未解決的依賴關係問題,這個依賴關係被build.properties文件修復了,但現在它不想在編譯Build.scala文件時包含play api。
[info] Loading project definition from
/home/caskman/ScalaProjects/CorpusBrowserMultiTest/project
[info] Updating
{file:/home/caskman/ScalaProjects/CorpusBrowserMultiTest/project/}default-20bdad..
[info] Resolving org.scala-sbt#precompiled-2_10_0-m7;0.12.1 ...
[info] Done updating.
[info] Compiling 1 Scala source to
/home/caskman/ScalaProjects/CorpusBrowserMultiTest/project/target/scala-2.9.2/sbt0.12/classes...
[error] /home/caskman/ScalaProjects/CorpusBrowserMultiTest/project/Build.scala:3: not found: object play
[error] import play.Project._
[error] ^
[error] one error found
這裏的Build.scala
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "PlayProject"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
jdbc,
anorm
)
val subProject = Project("subProject",file("subProject-dir"))
val main = play.Project(appName, appVersion, appDependencies, path = file("playProject"))
.dependsOn(subProject)
}