【问题标题】:Scala play with reactivemongo, not workingScala玩reactivemongo,不工作
【发布时间】:2018-04-20 05:27:06
【问题描述】:

我正在尝试关注tutorial,但我无法让 reactivemongo 工作:

这是我的错误:

  UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.reactivemongo#play2-reactivemongo_2.12;0.11.7.play24: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]      org.reactivemongo:play2-reactivemongo_2.12:0.11.7.play24 (/Users/jwan/Desktop/programming/scala_play/rest-api/build.sbt#L12-20)

这是我的built.sbt

name := """rest-api"""
organization := "com.example"

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.12.4"

libraryDependencies += guice
libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "3.1.2" % Test
libraryDependencies ++= Seq(
  jdbc,
  cache,
  ws,
  specs2 % Test,
  "org.reactivemongo" %% "play2-reactivemongo" % "0.11.7.play24",
  "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test"
)

// Adds additional packages into Twirl
//TwirlKeys.templateImports += "com.example.controllers._"

// Adds additional packages into conf/routes
// play.sbt.routes.RoutesKeys.routesImport += "com.example.binders._"

这是我的application.conf

# https://www.playframework.com/documentation/latest/Configuration

play.modules.enabled += "play.modules.reactivemongo.ReactiveMongoModule"

mongodb.uri = "mongodb://localhost:27017/getting-started-play-scala"

我无法让sbt run 工作。有什么想法吗?

【问题讨论】:

    标签: scala playframework


    【解决方案1】:

    根据https://mvnrepository.com/artifact/org.reactivemongo/play2-reactivemongo.

    reactivemongo 0.11.7.play24 所需的 scala 版本是 2.11。 为 scalaVersion 尝试 0.13.0-play26 := "2.12.4" 并播放 26。

    libraryDependencies += "org.reactivemongo" %% "play2-reactivemongo" % "0.13.0-play26"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-25
      • 2014-12-30
      • 2016-06-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-15
      相关资源
      最近更新 更多