All,
I'm trying to get Play Framework to recognize JVM arguments in all modes (test, run start) by setting them in Build.scala.
Unfortunately, Play ignores everything I've thrown at it.
I've set Keys.javaOptions and Keys.fork, but it SBT flat out ignores the fork command. I also tried going at this by replacing Build.scala with build.sbt, but that doesn't seem to work either.
I realize you can set JAVA_OPTS or PLAY_OPTS in your environment, but this is really lousy way of doing things. One should be able to configure this at the application level and play should be smart enough to either spawn a new process or re-launch itself with the appropriate configuration.
Anyone able to get this to work? If so, can you provide a complete, working solution?
The Play Framework SBT keys override javaOptions you pass, and therefore it will not work. The way to do it ,according to the documentation, is to pass those arguments at the start command.
The syntax changes a bit from version to version, but at 2.2.x it is:
$ /path/to/bin/<project-name> -J-Xms128M -J-Xmx512m -J-server
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With