Search code examples
scalasbtakka

New sbt application using the akka-http template, how to determine resolvers and add maven central?


I have a new sbt application that I built using the akka http g8 template.

I am trying to add reactivemongo 1.0 to my build and I am getting this error:

not found: https://repo1.maven.org/maven2/org/reactivemongo/reactivemongo_2.13/1.0/reactivemongo_2.13-1.0.pom

The documentation says this library is in maven central.

How can I determine which resolver my project is using by default currently in sbt?

Is it possible that this library is not built for scala 2.13.3 or 2.13.1?

How can I debug this type of error.

Thanks!

build.sbt:

import Dependencies._

lazy val akkaHttpVersion = "10.2.1"
lazy val akkaVersion     = "2.6.10"

lazy val root = (project in file("."))
  .settings(
    inThisBuild(
      List(
        organization := "com.example",
        scalaVersion := "2.13.3"
      )
    ),
    name := "akka-http",
    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,
          "ch.qos.logback"           % "logback-classic"           % "1.2.3",
          "com.softwaremill.macwire" %% "macros"                   % "2.3.3" % "provided",
          "com.softwaremill.macwire" %% "util"                     % "2.3.3" % "provided",
          "com.github.blemale"       %% "scaffeine"                % "3.1.0" % "compile",
          "org.typelevel"            %% "cats-core"                % "2.1.1",
          "com.lihaoyi"              %% "scalatags"                % "0.8.2",
          "com.github.pureconfig"    %% "pureconfig"               % "0.13.0",
          "org.reactivemongo"        %% "reactivemongo"            % "1.0",
          "com.typesafe.akka"        %% "akka-http-testkit"        % akkaHttpVersion % Test,
          "com.typesafe.akka"        %% "akka-actor-testkit-typed" % akkaVersion % Test,
          "org.scalatest"            %% "scalatest"                % "3.0.8" % Test
        )
  )
  .enablePlugins(JavaAppPackaging)

Solution

  • Can you try replacing "org.reactivemongo" %% "reactivemongo" % "1.0" with "org.reactivemongo" %% "reactivemongo" % "1.0.0" % "provided"?

    I copy it from Maven Repository https://mvnrepository.com/artifact/org.reactivemongo/reactivemongo_2.13/1.0.0