How to refer to one configuration variable from other configuration variable inside Config.groovy

后端 未结 1 922
陌清茗
陌清茗 2021-01-06 08:12

For example:

Config.groovy:

// ...
grails.variable1 = \"a\"
grails.varibale2 = \"${grails.variable1}bc\"
//...

UPDATE 1

相关标签:
1条回答
  • 2021-01-06 08:52

    You need to declare a variable:

    def rootVar = 'a'
    grails.variable1 = rootVar
    grails.varibale2 = "${rootVar}bc"
    

    Or you might be able to do it via a closure (not tested):

    grails.variable1 = 'a'
    grails.varibale2 = { -> "${grails.variable1}bc" }()
    
    0 讨论(0)
提交回复
热议问题