简体   繁体   中英

Grails: How to change appname in application.properties

How to change app.name for a groovy grails application? I have a default value configured in application.properties metadata file.

I am using grails 2.1.1 version. I have tried using Metadata class to change the app.name, but failed to set value.

And I also tried setProperty("app.name", "myapp") in BuildConfig.groovy file. But it did not work.

Both scenarios uses the default value which is in application.properties file.

To stream line, I wanted to configure app.name in an external file. and overwrite at run time. Please let me know how can I do this?

Any help is appreciated.

您可以使用以下命令从Config.groovy访问application.properties中的app.name:appName = grails.util.Metadata.current.'app.name'

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM