O'Reilly logo

Play Framework Cookbook - Second Edition by Giancarlo Inductivo, Alexander Reelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with modules

You can utilize other Play Framework or third-party modules in your Play application. This is easily done by editing the build file (build.sbt) and declaring library dependencies in the style of sbt dependency declaration.

How to do it…

You need to perform the following steps to declare a module:

  1. Open the build.sbt file and add the following lines, using the notation of the group ID % module name % version while declaring library dependencies:
        libraryDependencies ++= Seq(
          jdbc,
          "mysql" % "mysql-connector-java" % "5.1.28"
        )
  2. Once the changes to build.sbt have been saved, head over to the command line and have Activator download the newly declared dependencies:
        $ activator clean dependencies
    

How it works…

In this recipe, we declare ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required