rdmueller
rdmueller

Reputation: 11022

access to application properties (${appName}) in external configuration

I've externalized my Grails configuration basically the same way as the config file suggests. I've done it all the time with my 1.3 projects and the line

grails.serverURL = "http://localhost:8080/${appName}"

in the external config worked great. Now I experience the problem with 2.0 that Grails seems not to be able to resolve the ${appName} - it will use [:] instead in redirects.

As soon as I move this line back to the internal configuration, everything works fine.

Is there any way to move this configuration line to the external configuration? Am I doing something wrong?

Upvotes: 8

Views: 4108

Answers (1)

Burt Beckwith
Burt Beckwith

Reputation: 75671

You can use ${grails.util.Metadata.current.getApplicationName()} instead.

Note that since Metadata implements Map you can't shorten that to ${grails.util.Metadata.current.applicationName} since the key isn't applicationName.

Upvotes: 15

Related Questions