Online dependence not found in .ivy2 file and not found by Intellij Idea

微笑、不失礼 提交于 2019-12-02 10:56:02

问题


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 underlines the toImport line saying that it cannot find it. How can I solve this?


回答1:


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: https://youtrack.jetbrains.com/issue/SCL-12355

To work around this problem, one "fix" is to manually rename the modules in project structure to this:

... but that will get lost after refreshing the project from 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.



来源:https://stackoverflow.com/questions/45463978/online-dependence-not-found-in-ivy2-file-and-not-found-by-intellij-idea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!