Search code examples
scalaplayframework-2.0securesocial

Unresolved dependency when trying to install SecureSocial in Play


First steps with Scala and with Play. I'm trying to install the SecureSocial plugin, but I can't. I'm interested in the resolution itself, and anything (answer or resources) than can improve my knowledge of the tools.

In the Scala webpage (http://securesocial.ws/guide/installation.html) instructions are:

And that's the first problem. I don't have Build.scala. Anyway, I have a /project/plugins.sbt that has a very similar structure.

Even with a different format, I'm able to put the lines:

When I try to compile, an enormous exception stack appears. Basically:

  • sbt.ResolveException: unresolved dependency: securesocial#securesocial;2.1.2: not found

Seems to be trying:

If I check http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, I can't see anything similar to the path previously written. For example, you can see, where docs and source is placed, but in JAR format, not pom:

Am I doing it completely wrong?

Thanks!


Solution

  • SecureSocial uses an Ivy-Style repository, not Maven style. Hence, you have to declare your resolver to use Ivy style:

    resolvers += Resolver.url("sbt-plugin-releases", 
        new URL("http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/"))
        (Resolver.ivyStylePatterns)
    

    (line breaks added for readability)

    Maven and Ivy dictate different directory structures. SBT supports both, but defaults to Maven style. So if you want to use a repository that uses another directory structure, you have to tell sbt which structure that is.

    Furthermore,

    addSbtPlugin("securesocial" %% "securesocial" % "2.1.2")
    

    is not the right choice to include dependencies - it is used to include plugins for sbt itself. Instead, use

    libraryDependencies += "securesocial" %% "securesocial" % "2.1.2"