我在我的项目中使用了akka-http和reactivemongo,并使用了akka-http-spray json编组/解组case类。下面是它们的依赖关系:
"com.typesafe.akka" %% "akka-http" % "10.1.3"
"com.typesafe.akka" %% "akka-stream" % "2.5.14"
"com.typesafe.akka" %% "akka-http-spray-json" % "10.1.3"
"org.reactivemongo" %% "reactivemongo" % "0.16.0"我的代码在另一个我没有使用reactivemongo的项目中运行良好。但现在我得到了一个错误-
[error] /home/ficode/project/ficode-sentinll/sentinll-common/src/main/scala/ficode/sentinll/common/model/CategoryManagement.scala:32:69: Symbol 'term akka.stream' is missing from the classpath.
[error] This symbol is required by 'method akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport.sprayJsonSourceReader'.
[error] Make sure that term stream is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
[error] A full rebuild may help if 'SprayJsonSupport.class' was compiled against an incompatible version of akka.
[error] implicit val requestHeaderFormat = jsonFormat1(RequestHeader)
[error] ^
[error] one error found我还收到了关于reactivemongo和akka-stream中版本冲突的警告。
[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn] * com.typesafe.akka:akka-actor_2.11:2.5.14 is selected over 2.3.13
[warn] +- com.typesafe.akka:akka-stream_2.11:2.5.14 () (depends on 2.5.14)
[warn] +- org.reactivemongo:reactivemongo_2.11:0.16.0 () (depends on 2.3.13)
[warn] Run 'evicted' to see detailed eviction warnings我试图从reactivemongo中排除akka依赖项。警告消失了,但错误没有消失。
你知道我该怎么解决这个问题吗?提前谢谢。
发布于 2018-08-30 10:48:24
是否尝试在SBT中添加覆盖?
dependencyOverrides ++= Set("com.typesafe.akka" % "akka-http-spray-json" % "10.1.3")https://stackoverflow.com/questions/52077952
复制相似问题