How do I change the default port (9000) that Play uses when I execute the “debug run” command?

playframework, playframework-2.0

Solution

To run in debug mode with the http listener on port `8991`, run:

play debug "run 8991"

Problem

I usually start my Play 2.0 application with `play "~run 8991"` to run my application on port 8991 instead of the default port 9000, as described in this other Stack Overflow question. But how can I change the default port when I want to debug my application? `play "debug run 8991"`* still uses port 9000; the `8991` will get ignored. (Note to close voters, this is NOT a dupe of the linked question. That one says nothing about debugging.)

Original source

Related problems