访问外部配置中的应用程序属性($ {appName})

rdm*_*ler 8 grails

我已经外化了我的Grails配置,基本上与配置文件建议的方式相同.我已经完成了我的1.3项目和生产线

grails.serverURL = "http://localhost:8080/${appName}"
Run Code Online (Sandbox Code Playgroud)

在外部配置工作得很好.现在我遇到2.0的问题,Grails似乎无法解析$ {appName} - 它将在重定向中使用[:].

一旦我将这一行移回内部配置,一切正常.

有没有办法将此配置行移动到外部配置?难道我做错了什么?

Bur*_*ith 15

你可以${grails.util.Metadata.current.getApplicationName()}改用.

请注意,由于Metadata实现,Map您不能缩短它,${grails.util.Metadata.current.applicationName}因为密钥不是applicationName.