Search code examples
scalamavensbtakka

Akka HTTP new SBT dependencies not installing with 'Unresolved dependencies path' ERROR


I am building an Akka HTTP project using Scala 3 and SBT.

The application was working fine before I added the new dependencies below to build.sbt.

The new dependencies added are: akka-http-circe, akka-http-json4s, authentikat-jwt, json4s-native, circe-generic, slf4j-simple.

Immediately I added the new dependencies to build.sbt, I began getting the errors:

Note: Unresolved dependencies path:

not found: C:\Users\hp\.ivy2\localde.heikoseeberger\akka-http-circe_2.13\1.27.0\ivys\ivy.xml

not found: https://repo1.maven.org/maven2/de/heikoseeberger/akka-http-circe_2.13/1.27.0/akka-http-circe_2.13-1.27.0.pom

not found: https://repo.akka.io/maven/de/heikoseeberger/akka-http-circe_2.13/1.27.0/akka-http-circe_2.13-1.27.0.pom

Error downloading de.heikoseeberger:akka-http-circe_2.13:1.27.0

``

A similar error occurs with all the other new dependencies I added to build.sbt.

I thought it was a scala3 compatibility issue, that's why I added .cross(CrossVersion.for3Use2_13) to each new dependency.

But the issue persisted.

What could be the issue?

Thanks in advance!

The New dependencies added:


("com.typesafe.scala-logging" %% "scala-logging"   % "3.9.0").cross(CrossVersion.for3Use2_13),
("de.heikoseeberger" %% "akka-http-circe"          % "1.27.0").cross(CrossVersion.for3Use2_13),
("de.heikoseeberger" %% "akka-http-json4s"         % "1.22.0").cross(CrossVersion.for3Use2_13),
("com.jason-goodwin" %% "authentikat-jwt"          % "0.4.5").cross(CrossVersion.for3Use2_13),
("org.json4s"        %% "json4s-native"            % "3.6.1").cross(CrossVersion.for3Use2_13),
("io.circe"          %% "circe-generic"            % "0.11.1").cross(CrossVersion.for3Use2_13),
("org.slf4j"         %% "slf4j-simple"             % "1.7.25").cross(CrossVersion.for3Use2_13),

build.sbt:


lazy val akkaHttpVersion = "10.6.3"
lazy val akkaVersion    = "2.9.4"

resolvers += "Akka library repository".at("https://repo.akka.io/maven")

fork := true

lazy val root = (project in file(".")).
  settings(
    inThisBuild(List(
      organization    := "com.example",
      scalaVersion    := "3.3.3"
    )),
    name := "eskimi-bidding-agent",
    libraryDependencies ++= Seq(
      "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,
      "com.typesafe.akka" %% "akka-pki"                 % akkaVersion,
      ("com.typesafe.scala-logging" %% "scala-logging"   % "3.9.0").cross(CrossVersion.for3Use2_13),
      ("de.heikoseeberger" %% "akka-http-circe"          % "1.27.0").cross(CrossVersion.for3Use2_13),
      ("de.heikoseeberger" %% "akka-http-json4s"         % "1.22.0").cross(CrossVersion.for3Use2_13),
      ("com.jason-goodwin" %% "authentikat-jwt"          % "0.4.5").cross(CrossVersion.for3Use2_13),
      ("org.json4s"        %% "json4s-native"            % "3.6.1").cross(CrossVersion.for3Use2_13),
      ("io.circe"          %% "circe-generic"            % "0.11.1").cross(CrossVersion.for3Use2_13),
      ("org.slf4j"         %% "slf4j-simple"             % "1.7.25").cross(CrossVersion.for3Use2_13),
      "ch.qos.logback"    % "logback-classic"           % "1.2.11",

      "com.typesafe.akka" %% "akka-http-testkit"        % akkaHttpVersion % Test,
      "com.typesafe.akka" %% "akka-actor-testkit-typed" % akkaVersion     % Test,
      "org.scalatest"     %% "scalatest"                % "3.2.12"        % Test
    )
  )


Solution

  • Check your versions.

    For example akka-http-circe 1.27.0 is not published for 2.13 so you can't use for3Use2_13. For 2.13 akka-http-circe is published since 1.28.0

    https://mvnrepository.com/artifact/de.heikoseeberger/akka-http-circe

    Similarly scala-logging 3.9.0 is not published for 2.13. For 2.13 it's published since 3.9.3

    https://mvnrepository.com/artifact/com.typesafe.scala-logging/scala-logging

    https://mvnrepository.com/artifact/com.typesafe.scala-logging/scala-logging?repo=central

    There is scala-logging _3 https://repo1.maven.org/maven2/com/typesafe/scala-logging/scala-logging_3/

    Etc.