scala 为什么从 SBT 导入 Intellij 项目失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28095403/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why intellij import project from SBT failed
提问by Yann Moisan
I use IntelliJ Idea 14 Ultimate.
我使用 IntelliJ Idea 14 Ultimate。
I have a multimodule project with a project/Build.scala. Here is the layout of my project.
我有一个带有project/Build.scala. 这是我的项目的布局。
- myproject
- module 1
- module 2
- project
- Build.scala
- myproject
- module 1
- module 2
- project
- Build.scala
I try to use the native SBT from scala plugin. I choose Import project from external model and then select SBT. Then I select the root folder of my project and click on Finish.
我尝试使用 Scala 插件中的原生 SBT。我选择从外部模型导入项目,然后选择 SBT。然后我选择我的项目的根文件夹并单击完成。
But the project is not well imported. Libraries are downloaded but all imports are in red in submodules (cannot resolve).
但是项目没有很好的导入。库已下载,但子模块中的所有导入均为红色(无法解析)。
So I have to use sbt gen-idea, that works fine, but I would be very happy to get rid of it …
所以我必须使用 sbt gen-idea,这很好用,但我很乐意摆脱它……
回答by gopek
I had the same problem (IDEA 14 Ultimate). This solve that after import. File > Invalidate Caches / Restart... Shown here
我遇到了同样的问题(IDEA 14 Ultimate)。这解决了导入后的问题。File > Invalidate Caches / Restart... 显示在这里

