0

When I try to sbt build my project, the project build fails with an "extracting product structure failed" error. I am suspecting something related to the versions I am using for Alpakka and Akka.

Here is my build.sbt file:

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"
    )
  )

When I remove the alpakka dependency at the end of the library, the error goes away but I am unable to to build project because of the missing alpakka dependency.

Ultimately, I am just trying to implement this: https://akka.io/alpakka-samples/http-csv-to-kafka/step4.html

Gael: Here is the image of the error message from Intellij

When running sbt clean compile, I get the following error stack:

[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\2.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$38(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$1(LibraryManagement.scala:53)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:103)
[error]         at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:73)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:116)
[error]         at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:116)
[error]         at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:97)
[error]         at sbt.util.Tracked$.$anonfun$inputChangedW$1(Tracked.scala:219)
[error]         at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:130)
[error]         at sbt.Classpaths$.$anonfun$updateTask0$5(Defaults.scala:3486)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]         at sbt.Execute.$anonfun$submit$2(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$1(Execute.scala:282)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]         at sbt.CompletionService$$anon$2.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\2.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
  • Your `build.sbt` works perfectly fine for me. Do you have another error message? – Gaël J May 12 '21 at 12:43
  • @GaëlJ I added a link to the image of the error messages in Intellij. If I remove the dependency on alpakka, this error goes away but because the library is no longer there, references to its objects in the code causes build errors. Thank you! – Islam Hussein May 12 '21 at 14:35
  • In IntelliJ Idea, you can click on the different lines you show in your screenshot, one should display more details on the right. You can also just get rid of IntelliJ for now and run `sbt clean compile` in a shell to check if it's better. – Gaël J May 12 '21 at 16:21
  • Thanks again, @GaëlJ. Nothing is shown in the Intellij error report. I added the response from the ```sbt clean compile``` command t my post. – Islam Hussein May 12 '21 at 16:29
  • 1
    `akka-stream-alpakka-reference` doesn't seem to exist, so I'm curious why it's there (it's not in the github version of the project) – Levi Ramsey May 12 '21 at 16:58
  • @LeviRamsey what I find bewildering is that GaelJ did not have a problem with the build.sbt file. – Islam Hussein May 12 '21 at 17:10
  • I'd leave @GaëlJ to reply, but I think it worked for me until I actually told it to try to download dependencies. – Levi Ramsey May 13 '21 at 00:39
  • Oh yeah, I didn't run compile myself, I just ran SBT to check the build.sbt was not having a typo. I wrongly assumed the dependency exist. Good catch! – Gaël J May 13 '21 at 06:56

1 Answers1

2

It seems that I needed to use "com.lightbend.akka" %% "akka-stream-alpakka-csv" % "2.0.2" instead of "com.lightbend.akka" %% "akka-stream-alpakka-reference" % "2.0.2".