In my Config.groovy file, I have the grails.serverURL set for development, but the port is hard-coded to 8080.
A few developers, have different ports configured to prevent other running apps from conflicting (local-dev SOA for example).
What I've tried hasn't given me happy results.
-Dserver-port=8090
in my run-app command ${server.port}
and ${grails.server.port.http}
in the grails.serverURL string How can I reference the -Dserver-app
value for use in the Config.groovy?
you can access your system properties using System.getProperty()
For example, run your grails app with:
grails -Dserver-app="foobar" run-app
Then in Config.groovy:
def ServerApp = System.getProperty("server-app"); //returns "foobar"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.