2

安装了 scala、giter8、sbt (0.11.3) 和 maven 的全新 Homebrew,并且大部分内容都已检查完毕。brew doctor 显示了我通过手动安装 pcre 和 python 2.7 制作的已知模块。当我获得 play-scala 模板然后第一次运行它时,我在 slf4j 上得到以下未解决的依赖项

# sudo sbt run
...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::                                 
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.slf4j#slf4j-api;1.6.1: configuration not found in org.slf4j#slf4j-api;1.6.1: 'compile'. It was required from org.hibernate#hibernate-validator;4.2.0.Final compile
[warn]  :: commons-codec#commons-codec;1.4: configuration not found in commons-codec#commons-codec;1.4: 'compile'. It was required from org.apache.httpcomponents#httpclient;4.1.2 compile
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/Users/homedir/typesafe/my_app/}my_app/:update: sbt.ResolveException: unresolved dependency: org.slf4j#slf4j-api;1.6.1: configuration not found in org.slf4j#slf4j-api;1.6.1: 'compile'. It was required from org.hibernate#hibernate-validator;4.2.0.Final compile
[error] unresolved dependency: commons-codec#commons-codec;1.4: configuration not found in commons-codec#commons-codec;1.4: 'compile'. It was required from org.apache.httpcomponents#httpclient;4.1.2 compile
[warn] some of the dependencies were not recompiled properly, so classloader is not avaialable
[info] Updating {file:/Users/homedir/typesafe/my_app/}my_app...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::                                 
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.slf4j#slf4j-api;1.6.1: configuration not found in org.slf4j#slf4j-api;1.6.1: 'compile'. It was required from org.hibernate#hibernate-validator;4.2.0.Final compile
[warn]  :: commons-codec#commons-codec;1.4: configuration not found in commons-codec#commons-codec;1.4: 'compile'. It was required from org.apache.httpcomponents#httpclient;4.1.2 compile
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/Users/homedir/typesafe/my_app/}my_app/:update: sbt.ResolveException: unresolved dependency: org.slf4j#slf4j-api;1.6.1: configuration not found in org.slf4j#slf4j-api;1.6.1: 'compile'. It was required from org.hibernate#hibernate-validator;4.2.0.Final compile
[error] unresolved dependency: commons-codec#commons-codec;1.4: configuration not found in commons-codec#commons-codec;1.4: 'compile'. It was required from org.apache.httpcomponents#httpclient;4.1.2 compile

手动运行清理、重新加载、更新:

# sudo sbt
[info] Loading project definition from /Users/homedir/typesafe/my_app/project
[info] Set current project to my_app (in build file:/Users/homedir/typesafe/my_app/)
[my_app] $ clean
[success] Total time: 0 s, completed Aug 15, 2012 7:23:10 AM
[my_app] $ reload
[info] Loading project definition from /Users/homedir/typesafe/my_app/project
[info] Set current project to my_app (in build file:/Users/homedir/typesafe/my_app/)
[my_app] $ update
[info] Updating {file:/Users/homedir/typesafe/my_app/}my_app...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::                                 
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.slf4j#slf4j-api;1.6.1: configuration not found in org.slf4j#slf4j-api;1.6.1: 'compile'. It was required from org.hibernate#hibernate-validator;4.2.0.Final compile
[warn]  :: commons-codec#commons-codec;1.4: configuration not found in commons-codec#commons-codec;1.4: 'compile'. It was required from org.apache.httpcomponents#httpclient;4.1.2 compile
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/Users/homedir/typesafe/my_app/}my_app/:update: sbt.ResolveException: unresolved dependency: org.slf4j#slf4j-api;1.6.1: configuration not found in org.slf4j#slf4j-api;1.6.1: 'compile'. It was required from org.hibernate#hibernate-validator;4.2.0.Final compile
[error] unresolved dependency: commons-codec#commons-codec;1.4: configuration not found in commons-codec#commons-codec;1.4: 'compile'. It was required from org.apache.httpcomponents#httpclient;4.1.2 compile
[error] Total time: 7 s, completed Aug 15, 2012 7:23:23 AM

防止这种情况的正确方法是什么?这些dep不应该在初始化期间下载吗?

谢谢!

4

2 回答 2

2

由于这个问题,我最终删除了 ~/.m2 和 ~/.ivy2,然后进行了清理、更新、重新加载。随后一切正常。更新命令成功检索到 slf4j:

[my_app] $ update
[info] Updating {file:/Users/homedir/typesafe/my_app/}my_app...
[info] downloading http://repo.typesafe.com/typesafe/releases/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar ...
[info]  [SUCCESSFUL ] org.slf4j#slf4j-api;1.6.1!slf4j-api.jar (1481ms)
于 2012-08-15T15:15:04.100 回答
0

阅读这篇文章让我在推动/解决之前完成任务。

于 2013-09-17T20:05:52.860 回答