The question is: how do I retrieve the port number that play is listening on, no matter how it was defined (configuration, command line argument, or not at all).
Thi
Running in dev mode you need to use doubled notation
play -Dhttp.port=80 "run 80"
Unfortunately you have to do the same for default port
play -Dhttp.port=9000 "run 9000"
So I just suggest to write shell script (or .bat in Windows) for easy starting with all required params.