scala - Intellij 2018.3.1 无法从 SBT 项目转储项目结构

标签 scala intellij-idea sbt intellij-idea-2018

从 2018.2 更新到 Intellij Ultimate 2018.3 打破了我在 SBT 下的一个项目的项目同步。

它依赖于 build.sbt 中的另一个 git repo

val commonScheme = "git+ssh://git@"
lazy val commonsGit =
      ProjectRef(uri(s"${commonScheme}github.com/common-project.git#branch"), "commons")        
lazy val root =  Project("root", file("."))
  .dependsOn(commonsGit)

在项目导入期间,Intellij 可以转储项目结构但无法导入到 Intellij 项目模型并出现以下错误:URI scheme is not "file" :

intellij fails to import to project model


这是项目构建控制台的输出:

;reload; set _root_.org.jetbrains.sbt.StructureKeys.sbtStructureOptions in Global := "download resolveClassifiers" ;*/*:dumpStructureTo /private/var/folders/fh/63rcbt095332gl82cg0zv_p00000gn/T/sbt-structure.xml; session clear-all
[info] Loading global plugins from /Users/me/.sbt/0.13/plugins
[info] Loading project definition from /Users/me/dev/base-project/project
[info] Loading project definition from /Users/me/.sbt/0.13/staging/0f1bc3a71daf6972d134/ak-spark-common/project
[info] Set current project to common-project (in build file:/Users/me/dev/common-project/)
[info] Defining */*:sbtStructureOptions
[info] The new value will be used by */*:ssOptions
[info] Reapplying settings...
[info] Set current project to common-project (in build file:/Users/me/dev/common-project/)
[info] Resolving [dependencies]
...
[info] Writing structure to /private/var/folders/fh/63rcbt095332gl82cg0zv_p00000gn/T/sbt-structure.xml...
[info] Done.
[success] Total time: 31 s, completed Dec 18, 2018 12:19:55 PM
[info] Reapplying settings...
[info] Set current project to common-project (in build file:/Users/me/dev/common-project/)
URI scheme is not "file"

项目有效(在命令行中使用 SBT 编译 + 运行)否则。

由于 IntelliJ 无法转储项目结构,因此无法在我的代码中导入库,从而导致 IDE 无法使用。

最佳答案

正如@y.bedrov 所说,解决方案是:

Issue should be fixed since 2018.3.519 version: http://youtrack.jetbrains.com/issue/SCL-14635.

You could get nightly build here: http://confluence.jetbrains.com/display/SCA/Scala+Plugin+Nightly

  • 订阅每晚构建
  • 将 Intellij 的 Scala 插件更新到高于 2018.3.519 的版本
  • 刷新项目

关于scala - Intellij 2018.3.1 无法从 SBT 项目转储项目结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53832165/

相关文章:

scala - 处理多个选项并记录未找到的情况

java - 有没有办法直接在子类上查看 IntelliJ 中 super 类的属性/方法?

java - 如何从自定义 ToolWindow 调用 IntelliJ 重命名重构?

playframework - 是否有带有 sbt-maven-plugin 的在线存储库?

maven - 为什么 sbt 默认使用 Ivy,而不是 Maven?

java - 如何绕过或满足 Thrift 类的 scala 泛型类型

java - 在 Java 中确定 Scala 对象的类

scala - 为什么隐式def而不是类需要隐式转换?

java - SonarLint - RedundantThrowsDeclarationCheck - 误报?

scala - 如何在 Scala 中将 Option[List[String]] 转换为 List[String]?