1
votes

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 Answers

3
votes

When you are adding new dependencies to a play project,First you have to use the 'reload' command to download updated jar from internet and after that just fire 'eclipse' command again to re-create eclipse related config files. Then you should be able to find updated jars on your eclipse classpath.

Hope it helps!

1
votes

I had the similar problem with Play-2.2.1 while trying to add play-authentication dependency to my project. Mentioned above Getting started guide suggests to use resolvers like this:

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

But what I've finally found is that Resolver.ivyStylePatterns does not work! With this setting I always got "UNRESOLVED DEPENDENCIES" error.

Solution that works for me:

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

The list of changes and important points:

  1. top domain of github changed from com to io (but old one looks working too)
  2. instead of Resolver.ivyStylePatterns I use my own pattern constructed by Patterns helper. you can find more info about tokens in ivy documentation.
  3. NB! I don't use [organization] token cause it ends with 'com/feth' - not 'com.feth' as github needs.
0
votes

If you change the Build.scala you have to use the reload command o relaunch the play enviroment.

0
votes

It sounds to me like you did not copy the 'com' folder in the right place, which would cause that error. It's supposed to be copied into /app/com. Not sure if this is your problem or not, you may have this done properly.