[Play 2.6.x] How to override run mode

19 views
Skip to first unread message

Thibault Meyer

unread,
Jan 13, 2018, 3:58:01 AM1/13/18
to Play Framework
Hello,

I have a Play 2.6.x application compiled with the command "sbt stage", in our continuous integration process, we need to run application in "dev" mode but with the "staged" version (because some debug instruction are only run on dev mode and because some time Play compilation fail: usually the getter/setter enhancement leading to all forms processing malfunction).

Is it possible to passe a "-D" argument or using a environment variable to force Play application to run as "Mode.Dev" rather than "Mode.Prod" when we run ./target/universal/stage/bin/xxxx ?


Thanks

alex s

unread,
Jan 13, 2018, 6:17:23 AM1/13/18
to Play Framework
> we need to run application in "dev" mode but with the "staged" version

You could write a wrapper around play.core.server.DevServerStart and then override application entry point with the main option, e.g.: ./target/universal/stage/bin/my-application -main org.example.MyServerStart. That seems pretty pointless to me, however.


> because some debug instruction are only run on dev mode

There are exactly zero differences between prod and dev modes in that regard.
Reply all
Reply to author
Forward
0 new messages