首页 > 解决方案 > 使用 akka-http 模板的新 sbt 应用程序,如何确定解析器并添加 maven Central?

问题描述

我有一个使用 akka http g8 模板构建的新 sbt 应用程序。

我正在尝试将 reactivemongo 1.0 添加到我的构建中,但出现此错误:

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

文档说这个库位于 Maven 中心。

如何确定我的项目当前在 sbt 中默认使用的解析器?

这个库是否有可能不是为 scala 2.13.3 或 2.13.1 构建的?

如何调试此类错误。

谢谢!

构建.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)

标签: scalasbtakka

解决方案


你可以尝试用 替换"org.reactivemongo" %% "reactivemongo" % "1.0""org.reactivemongo" %% "reactivemongo" % "1.0.0" % "provided"

我从 Maven 存储库https://mvnrepository.com/artifact/org.reactivemongo/reactivemongo_2.13/1.0.0复制它


推荐阅读