玩!由于未解析的依赖项,无法构建框架项目

时间:2016-03-25 09:36:21

标签: java eclipse scala playframework playframework-2.0

我正在尝试使用"激活器"来构建一个游戏框架项目。

我在播放项目的根目录中输入了activator compile,我收到了以下错误。

unresolved dependency: org.scala-lang#scala-library;2.10.6: not found    
unresolved dependency: org.scala-lang#scala-compiler;2.10.6: not found      
unresolved dependency: org.scala-sbt#launcher-interface;1.0.0-M1: not found    
unresolved dependency: jline#jline;2.13: not found    
unresolved dependency: org.scala-sbt.ivy#ivy;2.3.0     
sbt-2cc8d2761242b072cedb0a04cb39435c4fa24f9a: not found    
unresolved dependency: org.scala-sbt#serialization_2.10;0.1.2: not found    
unresolved dependency: org.scala-lang#scala-reflect;2.10.6: not found    
Error during sbt execution: Error retrieving required libraries    
Error: Could not retrieve sbt 0.13.11    
  1. 我已将此行添加到project / plugins.sbt文件

    Resolvers += Resolver.url("binary-sbt-plugins",url("https://dl.bintray.com/sbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
    
  2. 还尝试使用这些命令手动下载所需文件

    $ cd ~/.ivy2/cache/org.scala-lang/
    $ mkdir -p scala-library && cd scala-library
    $ wget   https://raw.githubusercontent.com/peterklipfel/scala_koans/master/ivyrepo/cache/org.scala-lang/scala-library/ivy-2.10.2.xml
    $ wget https://raw.githubusercontent.com/peterklipfel/scala_koans/master/ivyrepo/cache/org.scala-lang/scala-library/ivydata-2.10.2.properties
    $ mkdir -p jars && cd jars
    $ wget https://github.com/peterklipfel/scala_koans/raw/master/ivyrepo/cache/org.scala-lang/scala-library/jars/scala-library-2.10.2.jar
    
  3. 我还将以下内容添加到project / plugins.sbt和构建文件

    resolvers += Resolver.sonatypeRepo("releases")
    
  4. 这些都没有成功解决这个问题。我应该提一下,同一个项目在其他机器上成功构建。

1 个答案:

答案 0 :(得分:0)

您提到同一项目在其他地方成功构建,这表明本地Ivy存储库需要重建。

要重建.ivy2,请将.ivy2(在您的主文件夹中)重命名为其他内容,然后再次尝试运行编译任务。

我建议使用项目中安装的activator,而不是全局activator。为此,请运行:

./activator compile

而不是:

activator compile