我在编译时遇到以下错误:
[error] (*:update) sbt.ResolveException: unresolved dependency: org.mongodb#casbah_2.11;2.7.4-SNAPSHOT: not found
使用此build.sbt文件:
name := """play-scala"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.1"
libraryDependencies ++= Seq(
jdbc,
anorm,
cache,
ws
)
libraryDependencies += "org.mongodb" %% "casbah" % "2.7.4-SNAPSHOT"
// For stable releases
resolvers += "Sonatype releases" at "https://oss.sonatype.org/content/repositories/releases"
// For SNAPSHOT releases
resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
我使用的是Typesafe Activator,并尝试了许多Casbah版本的组合(包括版本,而不是快照)和解析器。 installation instructions from the "official" MongoDB Casbah tutorial也不会工作。有什么想法吗?
答案 0 :(得分:7)
如果您转到发布和快照网址并尝试手动找到casbah,您会看到当前的snapshot url doesn't have anything for casbah。
另一方面,对于Scala 2.11,发行回购有2.7.3。 Check it out here
也许试试
libraryDependencies += "org.mongodb" %% "casbah" % "2.7.3"
答案 1 :(得分:1)
在build.sbt文件中使用以下依赖项:
libraryDependencies += "org.mongodb" %% "casbah" % "2.8.1"
答案 2 :(得分:0)
使用这些lib
"org.mongodb" %% "casbah" % "3.1.1",
"org.json4s" %% "json4s-jackson" % "3.5.2",
"org.json4s" %% "json4s-mongo" % "3.5.2"