How to contribute modules in Play Framework 2.0?
Asked Answered
T

4

23

The original Play Framework 1.x had an elegant and simple module management system. Coupled with the Play repository, it was a great way to quickly enhance an application with third party components & libraries.

With Play 2.0, things are very different.

How does one contribute the so called "modules"?

Throve answered 8/11, 2011 at 1:37 Comment(0)
T
7

Quoting Guillaume Bort from the mailing list:

modules are just standard subprojects.

[...] now as everything is compiled, your module routes file must define its own route for controllers.Assets.at

By the way, the route inclusion between modules is not ready yet. Will work on that soon.

Thesda answered 16/11, 2011 at 19:3 Comment(0)
C
5

Simply explained, now any SBT project can be a Module. Which is (somehow) an improvement, as you can import existing projects without having to convert them to a specific "Play framework module project" format.

For example, in Play 1.x you have several modules which provide a lot of the logic inside a jar file that belongs to the "Play Module" project. The source of that jar is not in the same project, which may complicate debugging. With the new system you can simply import the sbt-jar project (no need to create a wrapper project) or, if you are importing a Play project that contains that other project, you can follow the dependencies more easily.

An additional benefit is that you can reuse full Play projects as Modules. Which means that your Admin module for application X can be created as a full and independent Play project and then reused in Application Z by just adding a line to the Sbt build file. Lots of possibilities in there.

Cheltenham answered 8/2, 2012 at 14:43 Comment(1)
Awesome, how to do it then? I was just starting to think using Play2.0 but there is no explanation how do I combine several projects and run them like I run a single project?Haws
C
1

If you want to create/contribute a module for Play 2.x and don't know where to start check out this two-parts tutorial.

Cain answered 5/12, 2012 at 5:55 Comment(0)
C
0

Have a look at https://github.com/playframework/modules.playframework.org/wiki.

This Play 2.0 appliction will be the official Play Framework modules directory, hosted at modules.playframework.org, and will replace the original Play 1.x modules page.

It's in an very early stage at the moment and help is certainly needed. Contribution is possible. Check out: https://github.com/playframework/modules.playframework.org

Calamity answered 11/4, 2012 at 9:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.