我有一个使用外部库的IntelliJ Idea项目.我在~/.ivy2/cache目录中找不到该库之一. sbt文件如下所示:
I have an IntelliJ Idea project that uses external libraries. I cannot find one of this libraries in the ~/.ivy2/cache directory. The sbt file looks like:
name := "myproject" scalaVersion := "2.11.8" lazy val toImport = RootProject(uri("someuri#hash")) lazy val root = (project in file(".")).dependsOn(toImport)IntelliJ Idea在toImport行下划线表示无法找到它.我该如何解决?
IntelliJ Idea underlines the toImport line saying that it cannot find it. How can I solve this?
推荐答案如果您的意思是RootProject被突出显示为红色,则似乎在IDEA导入可传递模块的方式方面遇到了问题.我已使用您的其他问题中的信息复制了此内容.并在Scala插件问题跟踪器上创建了一个问题: youtrack.jetbrains/issue /SCL-12355
If you mean the RootProject is highlighted red, it seem you've run into a problem with how IDEA imports transitive modules. I've reproduced this with the information from your other question and created an issue on the Scala plugin issue tracker: youtrack.jetbrains/issue/SCL-12355
要变通解决此问题,一个修复"是将项目结构中的模块手动重命名为此:
To work around this problem, one "fix" is to manually rename the modules in project structure to this:
...但是从sbt刷新项目后,它将丢失.
... but that will get lost after refreshing the project from sbt.
相反,我建议您在sbt选项中启用使用sbt进行构建和导入".您将出现突出显示错误,但是构建可以正常工作.
Instead, I suggest you enable the "use sbt for build and import" in the sbt options. You will have the highlighting error, but builds will work fine.
更多推荐
.ivy2文件中找不到并且Intellij Idea找不到在线依赖
发布评论