Specifying Play 2.0 port with "dist"

java, playframework, sbt

Solution

After running `play dist` and then extracting the generated bundle, you can start Play 2 on a different port by running:

./start -Dhttp.port=5432

Or if you would rather edit the `start` script you can update it to be:

#!/usr/bin/env sh

exec java $* -Dhttp.port=5432 -cp "`dirname $0`/lib/*" play.core.server.NettyServer `dirname $0`

And then run:

./start

Problem

I'm creating a packaged project using`dist` and am trying to modify the generated `start` script to run the app on port `9001`. Here is what is generated: ``` exec java $* -cp "`dirname $0`/lib/*" play.core.server.NettyServer `dirname $0` ``` Here is what I tried, which doesn't seem to work. ``` exec java $* -Dhttp.port=9001 -cp "`dirname $0`/lib/*" play.core.server.NettyServer `dirname $0` ``` Any ideas? I've also tried specifying `http.port=9001` in `application.conf` with no avail. It was very easy to do this in Play 1.2.X, seems a step backward.

Original source

Related problems