How to access one configuration variable from another configuration variable inside Config.groovy

For instance:

Config.groovy:

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

UPDATE 1

The method of working with grails shown above 2.2.3. For older versions of grails, use the proposed @tim_yates solution

+4
source share
1 answer

You need to declare a variable:

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

Or you could do it through closure (not tested):

 grails.variable1 = 'a' grails.varibale2 = { -> "${grails.variable1}bc" }() 
+9
source

Source: https://habr.com/ru/post/1499757/


All Articles