我得到了一个facebook连接的样本,我试着在上面找出答案。我一做新项目就把这个文件夹翻了个底朝天。我甚至在后面的教程文件夹中覆盖了facebook文件夹的示例。
每做三个项目,我就会解决这个问题。
我自己把每个写好的版本都改到了1.6.1,我安慰了"sbt干净的更新重新加载“,但是它没有工作。
在那之后,我找到了一些解决方案,但在这个页面"Unresolved Dependencies for a new play 2.0 scala project“上却找不到。
虚拟眼说
“吹走~/. away 2,~/m2”
但我根本找不到其中的两个。
c:\play\connect>sbt clean update reload
c:\play\connect>set SCRIPT_DIR=C:\play\
c:\play\connect>java -Xmx512M -jar "C:\play\sbt-launch.jar" clean update reload
[info] Loading project definition from C:\play\connect\project
[info] Set current project to FacebookConnectTestUsingPlay2 (in build file:/C:/p
lay/connect/)
[success] Total time: 0 s, completed 2012. 11. 10 오전 6:07:50
[info] Updating {file:/C:/play/connect/}FacebookConnectTestUsingPlay2...
[info] Resolving org.hibernate.javax.persistence#hibernate-jpa-2.0-api;1.0.1.Fin
[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-c
odec#commons-codec;1.4: 'compile'. It was required from org.apache.httpcomponent
s#httpclient;4.1.2 compile
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/C:/play/connect/}FacebookConnectTestUsingPlay2/*:update: sbt.Reso
lveException: unresolved dependency: org.slf4j#slf4j-api;1.6.1: configuration no
t found in org.slf4j#slf4j-api;1.6.1: 'compile'. It was required from org.hibern
ate#hibernate-validator;4.2.0.Final compile
[error] unresolved dependency: commons-codec#commons-codec;1.4: configuration no
t found in commons-codec#commons-codec;1.4: 'compile'. It was required from org.
apache.httpcomponents#httpclient;4.1.2 compile
[error] Total time: 10 s, completed 2012. 11. 10 오전 6:08:00发布于 2012-11-16 00:17:18
我自己又找到解决办法了。
基于以下示例
https://github.com/pawank/Facebook-Integration-in-Play-2.0-using-scribe-library
(因为它适用于版本Play 2.0,而不是2.0.4)
1.在plugins.sbt改为addSbtPlugin("play“% "sbt-plugin”% "2.0.4")
2.在build.properties,改为sbt.version=0.11.3
(别忘了Application.scala中的变化
lazy val config = play.Play.application().configuration()
val FBAppId = config.getString("fb.app.id")
val FBAppSecret = config.getString("fb.app.secretkey")
val FBAppCallback = config.getString("fb.app.callback"))就像我说过的,源代码是2.0版的,而不是最近的版本
https://stackoverflow.com/questions/13317162
复制相似问题