Play Framework does not recognize Java parameters (JVM args) passed to Build.scala

All,

I am trying to get the Play Framework to recognize JVM arguments in all modes (test, run start) by setting them to Build.scala.

Unfortunately, Play ignores everything that I have chosen.

I installed Keys.javaOptions and Keys.fork, but its SBT flat out ignores the fork command. I also tried switching to this by replacing Build.scala with build.sbt, but this also does not work.

I understand that you can set JAVA_OPTS or PLAY_OPTS in your environment, but this is a really disgusting way to do something. You need to be able to configure this at the application level, and the game must be smart enough to either start a new process or restart itself with the appropriate configuration.

Can anyone make this work? If so, can you provide a complete working solution?

+3
source share
1 answer

Play Framework SBT keys override the javaOptions you pass, and therefore they will not work. The way to do this, according to the documentation, is to pass these arguments in a start command.

The syntax varies slightly from version to version, but in 2.2.x it is:

$ /path/to/bin/<project-name> -J-Xms128M -J-Xmx512m -J-server

+3
source

All Articles