7

运行我的sbt构建,我得到以下未解决的依赖项

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.play#sbt-link;2.2.0: not found
[warn]  :: com.typesafe.play#play-exceptions;2.2.0: not found
[warn]  :: com.typesafe.play#routes-compiler_2.10;2.2.0: not found
[warn]  :: com.typesafe.play#templates-compiler_2.10;2.2.0: not found
[warn]  :: com.typesafe.play#console_2.10;2.2.0: not found
[warn]  :: net.contentobjects.jnotify#jnotify;0.94: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

我的项目结构如下所示:

parent
 |
  --> sbtApp1
  --> playApp
  --> sbtApp2
  --> project
      --> Build.scala
      --> plugins.sbt
  --> build.sbt

我的 parent/project/plugins.sbt 有以下内容: addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")

我在 parent/build.sbt 中添加了以下行,但我仍然遇到编译时失败。

libraryDependencies += "play" % "play_2.10" % "2.1.0"

4

3 回答 3

15

将此行添加到parent/project/plugins.sbt

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

瞧。(我怎么知道?因为 Play 2.2“入门指南”这么说,http://www.playframework.com/documentation/2.2.x/NewApplication。)

我认为你不需要这个libraryDependencies东西。

于 2013-10-21T00:34:14.537 回答
3

有问题

sbt.ResolveException: unresolved dependency: org.fusesource.hawtjni#hawtjni-runtime;1.8: configuration not found in org.fusesource.hawtjni#hawtjni-runtime;1.8: 'master(compile)'. Missing configuration: 'compile'. It was required from org.fusesource.leveldbjni#leveldbjni;1.7 compile

在 Fedora 22 上,解决方案很简单:

~]$rm -rf .ivy2/ .sbt/

我在互联网上看到各种答案告诉人们删除 .sbt 缓存,但 .ivy2/ 也会导致问题。如果删除这些不能解决问题,您也可以尝试删除 .maven2 目录。这迫使 ivy/gradle/maven 重新下载所有内容。不理想,但它有效。

于 2015-10-03T15:09:46.187 回答
1

您将 Play 2.1.0 与 Play 2.2.0 混为一谈。

使用不:

libraryDependencies += "play" % "play_2.10" % "2.1.0"

利用:

libraryDependencies += "com.typesafe.play" % "play_2.10" % "2.2.0"

请确保您至少有一个 SBT 解析器。

于 2013-10-22T19:41:36.717 回答