代码之家  ›  专栏  ›  技术社区  ›  Christopher Su

无法将casbah解析为sbt依赖项

  •  2
  • Christopher Su  · 技术社区  · 10 年前

    我在编译时遇到以下错误:

    [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 也不起作用。有什么想法吗?

    3 回复  |  直到 10 年前
        1
  •  7
  •   Todd    10 年前

    如果您转到发布和快照URL并尝试手动定位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"
    
        2
  •  0
  •   Nilesh    8 年前

    在build.sbt文件中使用以下依赖性:

    libraryDependencies += "org.mongodb" %% "casbah" % "2.8.1"
    
        3
  •  0
  •   KARTHIKEYAN.A    7 年前

    使用这些库

      "org.mongodb" %% "casbah" % "3.1.1",
      "org.json4s" %% "json4s-jackson" % "3.5.2",
      "org.json4s" %% "json4s-mongo" % "3.5.2"