3

Is there a way to package play project into self-contained jar / war file?

(the only way I found was to use the stage task and then run the server with the start script)

2 Answers2

2

There is a plugin called play2war that does that. Check it here: https://github.com/dlecan/play2-war-plugin

I havent tried it myself tho...

Jakob
  • 751
  • 4
  • 17
  • I used it on a play 2.2.x project successfully. For play 2.2.x projects, use the beta version - https://github.com/dlecan/play2-war-plugin/releases/tag/1.2-beta1 – Kevin Meredith Nov 14 '13 at 21:22
1

I personaly found the stage task very good.

You can also use the dist task to have a zip file containing everthing you need. (https://plus.google.com/u/0/108788785914419775677/posts/5kNbVAE1ZYe)

To deploy as war file, use the play2war plugin as mentionnned before. But deploying a play application as war is not optimal. To have full performance, prefer the stage task.

Yann Simon
  • 458
  • 3
  • 11
  • 1
    Do you think the dist task is more convenient than the stage task? –  Jan 31 '13 at 13:36
  • There are opinions that `dist` task is more recent than `stage`, of course they should work with similar effects anyway it's possible that in `stage` _may have_ more bugs. – biesior Jan 31 '13 at 14:13
  • I used the `dist` task to have a zip ready to be copied on servers. The `dist` task should use the `stage` one. – Yann Simon Feb 06 '13 at 13:58
  • @KevinMeredith because play uses Netty that performs very well. The async IO is well supported. The war plugin, on the other hand, must conform to the servlet container that is not well suited for async IO. – Yann Simon Feb 11 '14 at 13:26