2013-10-18 77 views
6

运行我的sbt构建,我收到以下未解决的依赖关系未解决的依赖关系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 

我的父母/项目/ plugins.sbt有以下几点: addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")

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

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

回答

14

此行添加到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的东西。

+0

令人难过的是,我没有像使用链接那样手动安装sbt,而是使用了激活器。不过,您的修复仍然有效,谢谢! – cib

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/ 

我见过的互联网告诉人们删除名.bst缓存在不同的答案,但.ivy2 /也造成一个问题。如果删除这些文件不能解决问题,您也可以尝试删除.maven2目录。这迫使常春藤/ gradle/maven重新下载所有内容。不理想,但它的工作原理。