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

Creating and using your own plugin

In this recipe, we will explore how to use the Play 2.0 plugin that will monitor the filesystem for a specified file. We will initialize our plugin as part of the Play web application lifecycle, and the main plugin logic will be triggered on application startup.

How to do it…

For Java, we need to perform the following steps:

  1. Run the foo_java application with Hot-Reloading enabled:
        activator "~run"
    
  2. Create the modules directory inside foo_java:
        mkdir modules
    
  3. Generate the project directory for our first plugin inside foo_java/modules:
        activator new filemon play-java
    
  4. Remove the contents of the modules/filemon/conf/application.conf file, as these settings will conflict with the main configuration file that we have ...

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