playframework/play1 — pull request #682 by kaiinkinen (2013-11-05 14:34:09+00:00)
Title: Allow configuration of jpda.port through the command line, as well as based on framework id in application.conf

Current it's possible to configure the http.port and https.port variables from both the command line and the application.conf file. Both variables also honor the framework id, so they can be customised and overridden per config like this:

http.port=9000
%myconf.http.port=1234

or from the command line like this
play test --http.port=12345

This pull request allows specifying the debug port in the same fashion, and also keeps the same precedence for the options, in descending order:
1) command line option --jpda.port=xxxx (most important)
2) by framework id in application.conf (%myconf.jpda.port=yyyy)
3) through normal application.conf (jpda.port=zzzz)
4) default port 8000

This request does not affect the way the command line switch -f behaves, so regardless of how the jpda.port variable is specified, it will still
a) fail to start the server if the port is reserved, and the '-f' option is specified
b) otherwise try to find a random free port if the port is reserved

Why this request?:
Having a debugger setup in the IDE, and having to change it often is cumbersome, especially since at least OS X seems to hog the debugger port for an extended period of time after shutdown of the service. This config allows using a specified port as a secondary option, or if running multiple play instances on the same dev machine.