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

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

问题描述

我有一个使用外部库的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插件问题跟踪器上创建了一个问题: https://youtrack.jetbrains.com/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: 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:

...但是从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找不到在线依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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