TL;DR : You can look for a complete working example here : play2MultiModule

Strangely, there are still few people asking about multimodule builds in Play! 2. I think this will change as the framework grow more popular.

Imagine you have a seperate model you want to use in a play app, and a client app, we can organize our project like this :

  - model
  - clientapp
  - playapp

You cannot have a common build between this three artefact. Play! 2 is based on sbt, but needs a specific launcher, some options and its own ivy repository.

But you can still have a multimodule build for you model and client artefacts.

The main problem is the definition of the Play! 2 build, you can define a module in the build, but it has to be in the playapp directory (Symlinks ?? ).

A solution to this problem is to use a source dependency in SBT. SBT is recursive by nature, so it will propagate the model’s dependencies and settings :

Hope this helps !

blog comments powered by Disqus


26 June 2012