【问题标题】:How to declare dependency on Play's Anorm for a standalone application?如何为独立应用程序声明对 Play 的 Anorm 的依赖?
【发布时间】:2014-10-21 07:53:36
【问题描述】:

在独立模式(不是 Play 应用程序的一部分)下使用 Play 的 anorm 包的最新版本(例如,2.3 或 2.4)的当前 sbt 语法是什么?

【问题讨论】:

  • @applicius 把它钉在下面。

标签: scala sbt anorm


【解决方案1】:

build.sbt:

resolvers ++= Seq(
  "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases/")

libraryDependencies ++= Seq(
  "com.typesafe.play" %% "anorm" % "2.3.6")

example

【讨论】:

  • 是的,我认为这是我通过 Google 找到的示例之一。它不起作用:[warn] Host repo.typeseafe.com not found. url=http://repo.typeseafe.com/typesafe/releases/com/typesafe/play/anorm_2.11/2.3.2/anorm_2.11-2.3.2.pom [info] You probably access the destination server through a proxy server that is not well configured.sbt.ResolveException: unresolved dependency: com.typesafe.play#anorm_2.11;2.3.2: not found
  • 它确实有效,所以你的问题在别处。 travis-ci.org/cchantep/acolyte/builds/31466513 。检查您的网络配置和/或可能的 HTTP 代理。
  • 我创建了一个仅包含此依赖项的build.sbt,并将上面的结果粘贴到我的问题中。
  • 也许你应该写repo.typesafe.com(如答案),而不是repo.typeseafe.com
【解决方案2】:

Anorm 现在发布如下,无需额外的解析器。

"org.playframework.anorm" %% "anorm" % "2.6.2"

【讨论】:

    猜你喜欢
    • 2014-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-10
    • 2019-05-11
    • 2010-10-26
    • 1970-01-01
    • 2021-12-12
    相关资源
    最近更新 更多