“未知的神器.未解决或未编入索引"scalatest 的错误 [英] "Unknown artifact. Not resolved or indexed" error for scalatest

查看:16
本文介绍了“未知的神器.未解决或未编入索引"scalatest 的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试修改 build.sbt 文件以在 IntelliJ IDEA 中添加 scalatest 依赖项.控制台中没有错误日志,但我得到了一个 Unknown artifact.未解决或未编入索引. 当我将鼠标悬停在下划线上时.我该如何解决这个问题?非常感谢!

I'm trying to modify the build.sbt file to add scalatest dependencies in IntelliJ IDEA. There's no error log in the console but I got a Unknown artifact. Not resolved or indexed. when I hovered my mouse over the underline. How do I solve this? Many thanks in advance!

这是我用来添加依赖项的行:libraryDependencies += "org.scalatest" % "scalatest_2.11" % "3.0.1" % "test"

This is the line I used to add dependency: libraryDependencies += "org.scalatest" % "scalatest_2.11" % "3.0.1" % "test"

这是我的屏幕的样子:

推荐答案

如果你刚刚添加了依赖,可能还没有下载.刷新/重新导入项目以执行此操作.

If you just added the dependency, it might not have been downloaded yet. Refresh/reimport the project to do so.

如果已经下载,在 IntelliJ 中按 Alt+Enter 在出现警告的行并选择更新项目解析器的索引"快速修复,然后选择本地缓存"索引并单击更新".

If it has already been downloaded, press Alt+Enter in IntelliJ on the lines with the warning and select the "update project resolvers' indexes" quickfix, then select the "local cache" index and click "update".

您可以通过检查更新"列中的日期来验证更新是否有效:

You can verify that the update worked by checking the date in the "Updated" column:

这篇关于“未知的神器.未解决或未编入索引"scalatest 的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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