【问题标题】:SBT does not want to enter my project (using project command)SBT 不想进入我的项目(使用 project 命令)
【发布时间】: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 ...

标签: scala sbt


【解决方案1】:

Eugene Yokota 是对的:我在 stample-web 文件夹中存在冲突,该文件夹在 scala 构建中设置了 stample-web 名称,但在具有 name := stample-search 的文件夹中的 build.sbt 有错误

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-11-05
    • 2013-11-28
    • 2018-08-08
    • 2015-04-22
    • 1970-01-01
    • 2012-02-13
    • 2014-02-10
    相关资源
    最近更新 更多