Alpakka 和 Akka 版本兼容性问题
Alpakka and Akka Version Compatibility Issue
当我尝试使用 sbt 构建我的项目时,项目构建失败并显示“提取产品结构失败”错误。我怀疑与我用于 Alpakka 和 Akka 的版本有关。
这是我的 build.sbt 文件:
lazy val akkaHttpVersion = "10.2.4" // "10.1.11"
lazy val akkaVersion = "2.6.14" // "2.5.31"
val JacksonVersion = "2.10.5.1"
lazy val root = (project in file(".")).
settings(
inThisBuild(List(
organization := "com.example",
scalaVersion := "2.13.4"//"2.12.11"
)),
name := "XYZ",
libraryDependencies ++= Seq(
"org.orekit" % "orekit" % "10.3",
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-actor-typed" % akkaVersion,
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % Test,
"com.typesafe.akka" %% "akka-actor-testkit-typed" % akkaVersion % Test,
"org.scalatest" %% "scalatest" % "3.1.4" % Test,
"org.ehcache" % "ehcache" % "3.1.3",
"org.apache.httpcomponents" % "httpclient" % "4.5.13",
"org.scala-lang.modules" %% "scala-parallel-collections" % "0.2.0",
"org.apache.sling" % "sling-maven-plugin" % "2.4.2",
"com.fasterxml.jackson.module" % "jackson-module-scala" % "2.0.2",
"com.fasterxml.jackson.core" % "jackson-databind" % JacksonVersion,
"com.typesafe.akka" %% "akka-stream-kafka" % "2.0.7",
"com.lightbend.akka" %% "akka-stream-alpakka-reference" % "2.0.2"
)
)
当我删除库末尾的 alpakka 依赖项时,错误消失了,但由于缺少 alpakka 依赖项,我无法构建项目。
最终,我只是想实现这个:https://akka.io/alpakka-samples/http-csv-to-kafka/step4.html
Gael: Here is the image of the error message from Intellij
当 运行 sbt clean compile
时,我得到以下错误堆栈:
[warn]
[warn] Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading com.lightbend.akka:akka-stream-alpakka-reference_2.13:2.0.2
[error] Not found
[error] Not found
[error] not found: C:\Users\ihussein\.ivy2\localcom.lightbend.akka\akka-stream-alpakka-reference_2.13.0.2\ivys\ivy.xml
[error] not found: https://repo1.maven.org/maven2/com/lightbend/akka/akka-stream-alpakka-reference_2.13/2.0.2/akka-stream-alpakka-reference_2.13-2.0.2.pom
[error] at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:258)
[error] at lmcoursier.CoursierDependencyResolution.$anonfun$update(CoursierDependencyResolution.scala:227)
[error] at scala.util.Either$LeftProjection.map(Either.scala:573)
[error] at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:227)
[error] at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error] at sbt.internal.LibraryManagement$.resolve(LibraryManagement.scala:53)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate(LibraryManagement.scala:103)
[error] at sbt.util.Tracked$.$anonfun$lastOutput(Tracked.scala:73)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate(LibraryManagement.scala:116)
[error] at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate(LibraryManagement.scala:116)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$adapted(LibraryManagement.scala:97)
[error] at sbt.util.Tracked$.$anonfun$inputChangedW(Tracked.scala:219)
[error] at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:130)
[error] at sbt.Classpaths$.$anonfun$updateTask0(Defaults.scala:3486)
[error] at scala.Function1.$anonfun$compose(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon.work(Transform.scala:68)
[error] at sbt.Execute.$anonfun$submit(Execute.scala:282)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] at sbt.Execute.work(Execute.scala:291)
[error] at sbt.Execute.$anonfun$submit(Execute.scala:282)
[error] at sbt.ConcurrentRestrictions$$anon.$anonfun$submitValid(ConcurrentRestrictions.scala:265)
[error] at sbt.CompletionService$$anon.call(CompletionService.scala:64)
[error] at java.util.concurrent.FutureTask.run(Unknown Source)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[error] at java.util.concurrent.FutureTask.run(Unknown Source)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[error] at java.lang.Thread.run(Unknown Source)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.lightbend.akka:akka-stream-alpakka-reference_2.13:2.0.2
[error] Not found
[error] Not found
[error] not found: C:\Users\ihussein\.ivy2\localcom.lightbend.akka\akka-stream-alpakka-reference_2.13.0.2\ivys\ivy.xml
[error] not found: https://repo1.maven.org/maven2/com/lightbend/akka/akka-stream-alpakka-reference_2.13/2.0.2/akka-stream-alpakka-reference_2.13-2.0.2.pom
看来我需要使用 "com.lightbend.akka" %% "akka-stream-alpakka-csv" % "2.0.2"
而不是 "com.lightbend.akka" %% "akka-stream-alpakka-reference" % "2.0.2"
。