【问题标题】:Using SORM with Play Framework 2.3.8在 Play Framework 2.3.8 中使用 SORM
【发布时间】:2015-02-27 07:29:45
【问题描述】:

我正在查看Video introduction to Play Framework,但由于导入失败,我无法使用 SORM 创建 DB 对象。

我尝试在plugins.sbt 中添加依赖项,并重新启动了激活器,但激活器似乎找不到依赖项,我得到了一个unresolved error

addSbtPlugin("org.sorm-framework" % "sorm" % "0.3.14")
addSbtPlugin("com.h2database" % "h2" % "1.4.181")

我从Yvis repository 获得了版本。我也尝试了其他版本,但没有更好的运气。

【问题讨论】:

  • 应该添加为 libraryDependencies += "org.sorm-framework" % "sorm" % "0.3.16" in build.sbt,但不是 sbt 插件
  • 谢谢! Eclipse 在识别导入时遇到了麻烦,这让我更加困惑,但现在它可以工作了。如果您将您的评论转换为答案,我会将其标记为正确的。

标签: scala playframework-2.0 sorm


【解决方案1】:

应该添加为

libraryDependencies += "org.sorm-framework" % "sorm" % "0.3.16" 

build.sbt

但不像

addSbtPlugin("org.sorm-framework" % "sorm" % "0.3.14")

project/plugins.sbt

【讨论】:

    【解决方案2】:

    jilen 的回答很好;此外,在更改 build.sbt 后重新运行 sbt 可能是个好主意,例如(在项目根目录中):

    $ sbt
    ....
    $ compile
    ...
    $ eclipse
    

    (最后两个更适用于 Eclipse 用户 - 然后重新启动 Eclipse 以确保获取更改(刷新/清理可能还不够)。

    【讨论】:

    • 重新运行 SBT 解决了我的问题。谢谢。
    猜你喜欢
    • 2014-11-30
    • 2015-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多