【问题标题】:intellij: a required artifact is not listed by module descriptor: *#*!*.*intellij:模块描述符未列出所需的工件:*#*!*.*
【发布时间】:2019-01-25 14:05:50
【问题描述】:

在 Intellij 中刷新 sbt 项目时出现这些异常:

我删除了.intellij 文件夹但没有成功。

无论如何,到目前为止,似乎一切都按预期进行。

这是整个项目:https://github.com/pme123/play-binding-form

在 Justin Kaeser 发表评论后,我安装了 2018.2,现在 Intellij 可以工作了,但现在我在 `sbt shell 中看到了异常:

[info] Reapplying settings...
[info] Set current project to formRoot (in build file:/Users/mpa/dev/Github/pme123/play-binding-form/)
[error] a required artifact is not listed by module descriptor: *#*!*.*
[error] a required artifact is not listed by module descriptor: *#*!*.*
[error] a required artifact is not listed by module descriptor: *#*!*.*
...

【问题讨论】:

  • 嗨@pme,您能否在github上提供您的项目,或者至少提供一个解决此问题的最小工作示例。
  • 我将项目添加到问题中 - 感谢您查看。
  • 嗨@pme 欢迎您。

标签: scala intellij-idea sbt


【解决方案1】:

我现在找到了导致问题的更改:

build.sbt我的共享配置中:

lazy val shared = crossProject(JSPlatform, JVMPlatform)
  .crossType(CrossType.Pure)
  .settings(sharedSettings())
  .settings(sharedDependencies)
  .settings(
    publish := {},
    publishLocal := {},
    publishArtifact := false, // this line caused the problem
  )

删除该行时它可以工作。

如果有人知道原因就太好了!

【讨论】:

    【解决方案2】:

    这似乎是一个依赖解决问题。

    此外,在您的源代码中,您有 2 个具有相同内容根目录的项目:

    formRoot 和 play-finding-form。

    您不能有 2 个具有相同内容根目录的模块。 摆脱其中一个并适合您的 sbt 构建,File > Invalid Caches/Restart... 最后在 sbt 工具窗口中刷新所有 sbt 项目。

    希望对你有帮助。

    【讨论】:

    • 奇怪 - 你是对的 intellij 向我展示了这两个项目。但是sbt projects 只列出formRoot?那么我该如何修复build.sbt
    • 您正在使用跨项目,但 IntelliJ 目前无法完全支持跨项目(请参阅youtrack.jetbrains.com/issue/SCL-12945)。如果您想从 IDE 处理其中一个或另一个,您可能只需要手动启用 JS 或 JVM 版本。
    • @JustinKaeser 谢谢 - 我认为这可能与 github.com/mgilbertnz/idea-scalajs-bug 有关 - 因为这个更新开始了很多问题。
    • 您好,@JustinKaeser,感谢您指出这个有趣的问题。
    猜你喜欢
    • 2016-05-08
    • 2017-04-18
    • 2016-11-30
    • 2022-10-23
    • 2018-03-27
    • 2022-07-21
    • 2018-06-13
    • 1970-01-01
    • 2014-07-31
    相关资源
    最近更新 更多