سؤال

Got a fresh Homebrew install of scala, giter8, sbt (0.11.3), and maven and everything checks out for the most part. brew doctor shows just known mods I've made by installing pcre and python 2.7 manually. When I get the play-scala template and then run it for the first time, I get the following unresolved deps on 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

Running clean, reload, update manually:

# 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

What is the proper way to prevent this? Shouldn't these deps be downloaded during initialization?

Thanks!

هل كانت مفيدة؟

المحلول

Thanks to this question I ended up deleting ~/.m2 and ~/.ivy2, then did clean, update, reload. Subsequently everything worked. The update command successfully retrieved 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)

نصائح أخرى

Reading this lead me to doing the task before pushing/resolving.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top