简体   繁体   中英

How to contribute modules in Play Framework 2.0?

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 "?

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.

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM