![](/img/trans.png)
[英]Sbt dependency error with Spark Catalyst and Scala parser library
[英]Scala sbt library dependency - module not found error
我試圖將依賴項添加到json4,但出現模塊未找到錯誤。 我正在使用scala版本2.12.4和sbt版本1.1.1。 我的其他依賴項添加似乎是以正常方式添加的。
這是我在build.sbt中的代碼:
scalaVersion := "2.12.4"
libraryDependencies += "io.spray" %% "spray-json" % "1.3.4"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.4" % Test
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.4" % Test
libraryDependencies += "org.json4s" %% "json4s-native" % "3.3.0"
這是我收到的錯誤消息:
[warn] module not found: org.json4s#json4s-native_2.12;3.3.0
[warn] ==== local: tried
[warn] /Users/*****/.ivy2/local/org.json4s/json4s-native_2.12/3.3.0/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/json4s/json4s-native_2.12/3.3.0/ json4s-native_2.12-3.3.0.pom
[warn] ==== local-preloaded-ivy: tried
[warn] /Users/*****/.sbt/preloaded/org.json4s/json4s-native_2.12/3.3.0/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn] file:////Users/*****/.sbt/preloaded/org/json4s/json4s-native_2.12/3.3.0/ json4s-native_2.12-3.3.0.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.json4s#json4s-native_2.12;3.3.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
幫助表示贊賞,謝謝!
您需要使用此庫的較新版本。
試試這個: libraryDependencies += "org.json4s" %% "json4s-native" % "3.6.0-M3"
或某些較早的版本,但不是3.3.0
鏈接到版本: http : //search.maven.org/#search%7Cga%7C2%7Cg%3A%22org.json4s%22
編輯:此問題是與兼容性。 您使用新版本的Scala和sbt。 該庫的先前版本與此Scala版本或sbt版本不兼容。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.