我正在尝试使用 sbt 设置一个多项目。目前它非常简单(我这样做是为了学习)但我遇到了一些麻烦。
这是文件夹结构
MyProject
|
|-project
|
|- Build.scala
Build.scala 文件的内容:
import sbt._
import Keys._
object RootBuild extends Build {
lazy val root = Project(id = "root", base = file(".")) aggregate(bar, foo)
lazy val foo = Project(id = "foo", base = file("foo"), dependsOn(bar))
lazy val bar = Project(id = "bar", base = file("bar"))
}
当我运行时,sbt clean compile
我收到以下错误:
[info] Done updating.
[info] Compiling 1 Scala source to C:\MyProject\project\target\scala-2.9.2\sbt-0.12\classes...
[error] C:\MyProject\project\Build.scala:7: parameter specified twice: aggregate
[error] lazy val foo = Project(id = "foo", base = file("foo"), dependsOn(bar))
[error] ^
[error] one error found
[error] (compile:compile) Compilation failed
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? qTerminate batch job (Y/N)?
我不确定为什么会收到此错误,有关如何解决此问题的任何想法?