Fork me on GitHub

Building and Using Modules

Play2 is extensible using modules. The play2-maven-plugin supports the packaging and the inclusion of modules.

Importing a Module

Play2 modules are just libraries. So, you can use a module by declaring it in your pom file:

<dependency>
    <groupId>module.group.id</groupId>
    <artifactId>module.artifact.id</artifactId>
    <version>module.version</version>
</dependency>
The dependency must be in the _compile_ scope.

Building a Module

A Play 2 module is just a Play 2 application without a route file. To build a module, just use the plugin as usual. If you want to optimize the process, disable the distribution packaging (as a module is not a complete application):

<plugin>
    <groupId>de.akquinet.innovation.play2</groupId>
    <artifactId>play2-maven-plugin</artifactId>
    <version>1.2.2-SNAPSHOT</version>
    <extensions>true</extensions>
    <configuration>
        <buildDist>false</buildDist>
    </configuration>
</plugin>