scalaplayframeworksbtdependency-managementsecuresocial

Scala Play: how to add a github library to the project (securesocial)


I'm new to Scala and to Play. I'm trying to setup https://github.com/jaliss/securesocial which is a Play project implementing a login/registration component for a website. Unfortunately this project doesn't have a password strength validator built in (unless you provide your own password validator, the registration process only checks for Password length, not strength). So I'd like to add my own password validator using the following library:

https://github.com/tekul/szxcvbn

I cloned https://github.com/jaliss/securesocial

I can use sbt to build and run the project. How should I proceed to add https://github.com/tekul/szxcvbn as a dependency ? I think there must be a better way than to copy/paste the source of one project into the other.

Thanks for your help.


Solution

  • Maven Central lists the dependency as

    libraryDependencies += "eu.tekul" %% "szxcvbn" % "0.2"
    

    To import it to securesocial you would add it to securesocial/build.sbt like so:

    lazy val root = project.in( file(".") ).aggregate(core, scalaDemo, javaDemo) .settings(
         aggregate in update := false,
         libraryDependencies += "eu.tekul" %% "szxcvbn" % "0.2"
       )
    

    However, I believe szxcvbn cannot be imported into securesocial out-of-the-box because securesocial was built for Scala 2.11.x upwards, while the latest version of Scala szxcvbn was built against is only 2.9.x. You would first have to figure out how to build szxcvbn for 2.11.x upwards.