【问题标题】:Adding Jena to Play Framework 2.0将 Jena 添加到 Play Framework 2.0
【发布时间】:2013-06-12 14:34:14
【问题描述】:

我想将 Apache jena 作为依赖项添加到我的 play framework 2.0 项目中。

我遵循了我找到的教程here。我似乎找不到正确的下载解析器

val appDependencies = Seq(
    // Add your project dependencies here,
    "jena.apache.org" % "jena" % "2.10.1" % "test"
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
    // Add your own project settings here      
    resolvers += ***"apache-jena-2.10.1.zip" at "http://www.apache.org/dist/jena/binaries/"***
  )
The "resolvers +=..." part seems to be what I have done wrong. Yet I can't find any solutions.

【问题讨论】:

    标签: playframework playframework-2.0 jena


    【解决方案1】:

    您根本不必添加存储库。工件位于maven central repo

    只需将您的依赖项更改为:

    val appDependencies = Seq(
      // Add your project dependencies here,
      "org.apache.jena" % "apache-jena-libs" % "2.10.1" % "test"
    )
    

    并删除您尝试放入存储库的部分,使其看起来像这样:

    val main = play.Project(appName, appVersion, appDependencies).settings(
      // Add your own project settings here      
    )
    

    如果你想在你的主代码中使用 Jena 库(不仅仅是在单元测试中),那么去掉 test 部分的依赖,像这样:

    val appDependencies = Seq(
      // Add your project dependencies here,
      "org.apache.jena" % "apache-jena-libs" % "2.10.1"
    )
    

    【讨论】:

      猜你喜欢
      • 2012-06-25
      • 1970-01-01
      • 2013-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-11
      相关资源
      最近更新 更多