Grails 3 - change default port for run-app

Neill Robbins picture Neill Robbins · Feb 9, 2015 · Viewed 14.8k times · Source

In Grails3 grails -Dserver.port=9001 run-app doesn't appear to work:

I'm "getting address already bound 8080".

Any idea how to do this - ideally by passing a property to "gradle run"?

Answer

dmahapatro picture dmahapatro · Feb 9, 2015

You can use

server:
  port: 9001

in application.yml.

Or you can pass it via system environment. (e.g. SERVER_PORT=9001 grails run-app).