1

It seems the "play-authentication" plugin is not installed if i follow instructions at github https://github.com/joscha/play-authenticate/blob/master/samples/java/Getting%20Started.md

my eclipse IDE cannot find packages starting with "com.feth". i add the dependencies to Scala.build as described in readme above, then run clean and dependencies then compile..but the com.feth packages are not found. which means the play-auth plugin was not installed correctly. i wonder if there is a way to install the play-authenticate module correctly . am i missing something in the beside what is mentioned in readme above? it seems both dependencies of deadbolt-2 and play-authenticate are not resolved and installed. i also remarked a '%%' in the dependencies declaration in Scala.Build. but even if i use a single '%' the dependencies are not resolved and plugins are not installed. any help is much appreciated

my /project/Scala.Build file is below:

import sbt._
import Keys._
import PlayProject._

object ApplicationBuild extends Build {

    val appName         = "r2s2"
    val appVersion      = "1.0-SNAPSHOT"


 val appDependencies = Seq(
      "play-aws"      % "play-aws_2.9.1"      % "0.1",
      "be.objectify"  %%  "deadbolt-2"        % "1.1.3-SNAPSHOT",
      "com.feth"      %%  "play-authenticate" % "0.2.3-SNAPSHOT"
    )


    val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(


      resolvers += Resolver.url("Objectify Play Repository", url("http://schaloner.github.com/releases/"))(Resolver.ivyStylePatterns),
      resolvers += Resolver.url("Objectify Play Repository", url("http://schaloner.github.com/snapshots/"))(Resolver.ivyStylePatterns),

      resolvers += Resolver.url("play-easymail (release)", url("http://joscha.github.com/play-easymail/repo/releases/"))(Resolver.ivyStylePatterns),
      resolvers += Resolver.url("play-easymail (snapshot)", url("http://joscha.github.com/play-easymail/repo/snapshots/"))(Resolver.ivyStylePatterns),

      resolvers += Resolver.url("play-authenticate (release)", url("http://joscha.github.com/play-authenticate/repo/releases/"))(Resolver.ivyStylePatterns),
      resolvers += Resolver.url("play-authenticate (snapshot)", url("http://joscha.github.com/play-authenticate/repo/snapshots/"))(Resolver.ivyStylePatterns),
      resolvers += "Local Play Repository" at "/home/othman/play-2.0.4/repository/local"
    )



}
4

4 回答 4

3

当您向 play 项目添加新的依赖项时,首先您必须使用“重新加载”命令从 Internet 下载更新的 jar,然后再次触发“ eclipse ”命令以重新创建与 eclipse 相关的配置文件。然后你应该能够在你的 Eclipse 类路径中找到更新的 jar。

希望能帮助到你!

于 2013-04-08T07:12:56.130 回答
1

在尝试将播放身份验证依赖项添加到我的项目时,我遇到了与 Play-2.2.1 类似的问题。上面提到的入门指南建议使用这样的解析器:

resolvers += Resolver.url("play-authenticate (snapshot)", url("http://joscha.github.com/play-authenticate/repo/snapshots/"))(Resolver.ivyStylePatterns)

但我终于发现 Resolver.ivyStylePatterns 不起作用!使用此设置,我总是收到“未解决的依赖项”错误。

适合我的解决方案:

resolvers += Resolver.url("play-authenticate (snapshot)", url("http://joscha.github.io/play-authenticate/repo/snapshots/"))( Patterns("com.feth/[module]/[revision]/[type]s/[artifact].[ext]") )

更改列表和要点:

  1. github 的顶级域从 com 更改为 io(但旧的看起来也可以)
  2. 而不是 Resolver.ivyStylePatterns 我使用我自己的 Patterns helper 构建的模式。您可以在 ivy 文档中找到有关令牌的更多信息。
  3. 注意!我不使用 [organization] 令牌,因为它以 'com/feth' 结尾 - 而不是 github 需要的 'com.feth'。
于 2014-02-04T17:56:15.897 回答
0

如果您更改 Build.scala,您必须使用 reload 命令或重新启动播放环境。

于 2013-01-31T15:04:55.360 回答
0

在我看来,您没有将“com”文件夹复制到正确的位置,这会导致该错误。它应该被复制到/app/com。不确定这是否是您的问题,您可能已正确完成此操作。

于 2013-02-17T14:29:54.363 回答