How to add PLAY_BINARY_OPTS in playBinary script from build.gradle?

In playBinary script, it says

# Add default JVM options here. You can also use JAVA_OPTS and PLAY_BINARY_OPTS to pass JVM options to this script.

So I added PLAY_BINARY_OPTS="-Dhttp.port=9001", and play runs on port 9001 as expected.

However, every time I stage, the playBinary script is overwritten to default and I have to add PLAY_BINARY_OPTS manually.

Is there a way to set PLAY_BINARY_OPTS="-Dhttp.port=9999" from build.gradle?

1 Like