在 .ivy2 文件中找不到在线依赖,Intellij Idea 也没有找到 [英] Online dependence not found in .ivy2 file and not found by Intellij Idea

查看:27
本文介绍了在 .ivy2 文件中找不到在线依赖,Intellij Idea 也没有找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用外部库的 IntelliJ Idea 项目.我在 ~/.ivy2/cache 目录中找不到这些库之一.sbt 文件如下所示:

name := "myproject"scalaVersion := "2.11.8"惰性 val toImport = RootProject(uri("someuri#hash"))惰性val root =(文件中的项目(.")).dependsOn(toImport)

IntelliJ Idea 在 toImport 行下划线表示它找不到它.我该如何解决这个问题?

解决方案

如果您的意思是 RootProject 以红色突出显示,那么您似乎遇到了 IDEA 如何导入传递模块的问题.我已使用您的

...但是从 sbt 刷新项目后会丢失.

相反,我建议您在 sbt 选项中启用使用 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 underlines the toImport line saying that it cannot find it. How can I solve this?

解决方案

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.

这篇关于在 .ivy2 文件中找不到在线依赖,Intellij Idea 也没有找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆