Chapter 9. Play and more

 

This chapter covers

  • Using modules and creating your own
  • Publishing your modules
  • Using plugins
  • Deploying your application
  • Configuring the production environment

Now that we’ve taught you how to do a lot of things for yourself in Play, it’s time to show you how to use code that others have made. This chapter explains how to use Play modules, but also how to create your own and publish them so that others can use them. The second half of the chapter deals with how to deploy your application to production on your own machines or in the cloud. It also explains how to set up a front-end proxy and use SSL.

9.1. Modules

Any kind of serious software development project will use libraries to decrease the effort required from developers. JVM developers have access to a large body of libraries that can save developers a lot of time and stop them from reinventing the wheel. Play provides the same kind of thing in the form of modules. Currently available modules for Play 2 provide anything from alternate template engines to NoSQL database layers. This section will explain how to use a common module and, later on, how to build a module yourself.

9.1.1. Using modules

Play modules are, like any other library, a collection of files in a JAR. This means that you add a module to your project the same way you add any other library: you add it to appDependencies in project/Build.scala.

9.2. Plugins

9.3. Deploying to production

9.4. Summary