我正在尝试将 SBT 子项目与 Play Framework 一起使用,并按照此处的说明进行操作。
我创建了三个目录,一个包含主要播放内容,一个目录是 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)
}