In Play 2, these are implemented with an sbt plugin, so the following instructions are really just sbt tasks. You can use any sbt runner (e In Play 2, these are implemented with an sbt plugin, so the following are really just sbt tasks. You can use any sbt runner (e.g.
sbt
,play
, oractivator
). Below thesbt
runner is used, but you can substitute it for your sbt runner of choice.
For browser-reload mode:
sbt "run 8080"
For continuous-reload mode:
sbt "~run 8080"
To run in debug mode with the http listener on port 8080
, run:
sbt -jvm-debug 9999 "run 8080"
Start in Prod mode:
sbt "start -Dhttp.port=8080"
Create a staged distribution:
sbt stage
For Play 2.0.x and 2.1.x use the target/start
script (Unix Only):
target/start -Dhttp.port=8080
For Play 2.2.x & 2.3.x use the appropriate start script in the target/universal/stage/bin
directory:
target/universal/stage/bin/[appname] -Dhttp.port=8080
With Play 2.2.x & 2.3.x on Windows:
target\universal\stage\bin\[appname].bat -Dhttp.port=8080
To create a zip distribution:
sbt dist
For Play 2.0.x and 2.1.x use the start
script (Unix Only) in the extracted zip:
start -Dhttp.port=8080
For Play 2.2.x use the appropriate script in the [appname]-[version]/bin
directory:
[appname]-[version]/bin/[appname] -Dhttp.port=8080
With Play 2.2.x on Windows:
[appname]-[version]\bin\[appname].bat -Dhttp.port=8080
Change the http.port
value in the conf/application.conf
file or pass it command line:
play run --http.port=8080
Play 2.0-RC4
It is important to include quotes around the play command you want to run. In my case without the quotes play would still run on port 9000.
play "run 8080"
Alternatively you could run the following from the play console (type 'play' to get to the console)
run 8080
Hope this helps someone.
via sbt settings:
...
.settings(PlayKeys.playDefaultPort := 8855)
...
Version 2.0.3 :
Go to the project directory and just say play (and nothing after that). That will open the play console.
Next, say run 8080. That will start play on port 8080.
I hope this helps.
For Play 2.2.x on Windows with a distributable tar file I created a file in the distributable root directory called: {PROJECT_NAME}_config.txt and added:
-Dhttp.port=8080
Where {PROJECT_NAME} should be replaced with the name of your project. Then started the {PROJECT_NAME}.bat script as usual in the bin\ directory.
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