playframework - 将 Jena 添加到 Play Framework 2.0

标签 playframework playframework-2.0 jena

我想将 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.

最佳答案

您根本不必添加存储库。这些工件位于 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"
)

关于playframework - 将 Jena 添加到 Play Framework 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17068232/

相关文章:

java - 如何将规则转换为 SWRL 代码?

java - 使用 xml 文件中的 jena 创建 RDF 三元组和 RDF 存储

grails - Grails 或 Play 框架的动态 ACL?

java - 将 GET 参数添加到 Play Framework 2.2 响应

json - 使用 Play 2.1.1 在 JSON 中迭代数组

java - 删除模板输出中不必要的换行符?

scala - 在构造函数中调用方法

playframework-2.0 - 玩2.3,激活器不工作

Java SPARQL 选择查询

scala - 调度错误处理