sbt中未解决的依赖关系

时间:2013-10-18 21:32:39

标签: playframework sbt dependency-management

运行我的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

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

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

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

3 个答案:

答案 0 :(得分: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

答案 1 :(得分: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目录。这迫使常春藤/ gradle / maven重新下载所有内容。不理想,但它有效。

答案 2 :(得分:1)

将Play 2.1.0与Play 2.2.0混合使用。

使用NOT:

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

使用:

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

And be sure, that you have at least one resolver for SBT.