sbt:scalatutorial> run
[info] Updating
[info] Resolved dependencies
[warn]
[warn] Note: Unresolved dependencies path:
[error] stack trace is suppressed; run last macros / update for the full output
[error] (macros / update) sbt.librarymanagement.ResolveException: Error downloading org.wartremover:wartremover_2.13.11:3.0.6
[error] Not found
[error] Not found
[error] not found: C:\Users\username\.ivy2\localorg.wartremover\wartremover_2.13.11\3.0.6\ivys\ivy.xml
[error] not found:
https://repo1.maven.org/maven2/org/wartremover/wartremover_2.13.11/3.0.6/wartremover_2.13.11-3.0.6.pom
[error] Total time: 2 s, completed 2023. 8. 31. ?ㅽ썑 3:21:19
sbt:scalatutorial> addSbtPlugin("org.wartremover" % "sbt-wartremover" % "3.0.6")
[error] Expected ID character
[error] Not a valid command: addSbtPlugin (similar: plugin, plugins)
[error] Expected project ID
[error] Expected configuration
[error] Expected ':'
[error] Expected key
[error] Not a valid key: addSbtPlugin (similar: sbtPlugin, discoveredSbtPlugins)
[error] addSbtPlugin("org.wartremover" % "sbt-wartremover" % "3.0.6")
[error]
发生这个错误我该怎么办?
谁说你的wartremover版本旧了,更新一下吧。
是吗?或者如何解决这个问题?
在哪里使用addSbtPlugins?
Wartremover 自 3.1.3 起支持 2.13.11 - 请参阅MVN 存储库。作为编译器插件,它不能像普通库一样针对所有 2.13.x 版本,而是针对特定的次要版本。 Scala 的更新几乎总是意味着 Wartremover 的更新。
Sbt 插件添加到
.sbt
文件中,但不是在项目的根目录中,而是在 project/
目录中,按照惯例它是 project/plugins.sbt
。