【发布时间】:2013-08-29 02:53:59
【问题描述】:
我的构建很简单:
lazy val stampleWebProject = play.Project("stample-web", appVersion, appDependencies,path = file("stample-web"))
.dependsOn(stampleCoreProject,stampleSearchProject)
.aggregate(stampleCoreProject,stampleSearchProject)
lazy val stampleCoreProject = Project(id = "stample-core",base = file("stample-core"))
lazy val stampleSearchProject = Project(id = "stample-search",base = file("stample-search"))
所有这些项目都有一个带有依赖项的 build.sbt 文件,没有任何 scala 构建(据我所知,这将被忽略)
当我启动 SBT (12.4) 时,我得到以下信息:
[info] Set current project to stample-core (in build file:/home/sebastien/Bureau/Stample/)
> projects
[info] In file:/home/sebastien/Bureau/Stample/
[info] * stample-core
[info] stample-search
[info] stample-web
> project stample-search
[info] Set current project to stample-search (in build file:/home/sebastien/Bureau/Stample/)
> projects
[info] In file:/home/sebastien/Bureau/Stample/
[info] stample-core
[info] * stample-search
[info] stample-web
> project stample-core
[info] Set current project to stample-core (in build file:/home/sebastien/Bureau/Stample/)
> projects
[info] In file:/home/sebastien/Bureau/Stample/
[info] * stample-core
[info] stample-search
[info] stample-web
> project stample-web
[info] Set current project to stample-search (in build file:/home/sebastien/Bureau/Stample/)
[stample-search] $ projects
[info] In file:/home/sebastien/Bureau/Stample/
[info] stample-core
[info] stample-search
[info] * stample-web
[stample-search] $ compile
[info] Updating {file:/home/sebastien/Bureau/Stample/}stample-core...
[info] Resolving org.slf4j#slf4j-api;1.6.6 ...
[info] Done updating.
[info] Updating {file:/home/sebastien/Bureau/Stample/}stample-web...
[error] a module is not authorized to depend on itself: stample-search#stample-search_2.10;1.0
[error] (stample-web/*:update) java.lang.IllegalArgumentException: a module is not authorized to depend on itself: stample-search#stample-search_2.10;1.0
[error] Total time: 1 s, completed 26 août 2013 21:57:45
这里有些东西我不明白:
默认情况下我们所在的项目是如何选择的。我似乎在 SBT 13.0 中添加了文档,但在 12.4 多构建文档中没有看到它。
我怎么输入项目
stample-web,它告诉我我在stample-search为什么我的项目在我的 sbt 控制台中有一个特殊的显示(stample-web 或 stample-search,我真的不知道...)(这里出现:
[stample-search] $ compile,这和游戏项目有关系吗?-
为什么它不能编译stample-search,因为它在我的构建中不依赖于自己(我怀疑它试图编译web项目但有命名问题或其他什么?
这是一个 SBT 错误吗?如果是这样,是否可以使用新的 13.0 版本和 Play 框架?
【问题讨论】:
-
我无法使用 sbt 0.12.4 重现您的问题。
stample-web或任何其他子项目中是否有任何*.sbt文件或project目录?他们会被加载,并且可能会把事情搞砸。当你使用dependOn时,你不应该使用aggregate。 -
是的!你是绝对正确的,我不知道它是怎么来的,但我在 stample-web 文件夹中有一个意想不到的 sbt 文件,有
name := stample-search...