Plugin declaration

Now that we have defined a plugin, let's see how the Play Framework identifies and enables it for the application. ApplicationProvider for the production and development mode (static and reloadable applications, respectively) both rely on DefaultApplication, which is defined as follows:

class DefaultApplication(
  override val path: File,
  override val classloader: ClassLoader,
  override val sources: Option[SourceMapper],
  override val mode: Mode.Mode) extends Application with WithDefaultConfiguration with WithDefaultGlobal with WithDefaultPlugins

The trait WithDefaultPlugins line is responsible for binding the plugins to application's life cycle. It is defined as follows:

trait WithDefaultPlugins { self: Application => private[api] ...

Get Mastering Play Framework for Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.