.ivy2文件中找不到并且Intellij Idea找不到在线依赖

编程入门 行业动态 更新时间:2024-10-27 08:32:31
本文介绍了.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插件问题跟踪器上创建了一个问题: 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找不到在线依赖

本文发布于:2023-11-14 04:59:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586285.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:在线   找不到   中找   文件   Idea

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!