How to get Grails application name within Config.groovy?

前端 未结 2 896
抹茶落季
抹茶落季 2021-02-04 11:33

I want to include the Grails application name in some of my configuration settings in grails-app/Config.groovy. I\'ve tried many ways without success. For example

相关标签:
2条回答
  • 2021-02-04 12:34

    try this:

    edu.appname1 = appName
    

    or if you want to use as part of a longer configuration parameter

    edu.appname1 = "something.$appName.else"
    
    0 讨论(0)
  • 2021-02-04 12:35

    To get the appName in a config file that you're including with grails.config.locations you can use:

    appName = grails.util.Metadata.current.'app.name'
    
    0 讨论(0)
提交回复
热议问题