Now it is possible to use values of system properties and environment variables and assign them to bean properties. For this purpose we added functions which can be used in DSL and which will return values of:
- system property
prop('property-name')
orprop('property-name','default value')
- environment variable
env('variable-name')
Example of setting value of system property and environment variable to bean user
.
user { name = env('USER') home = prop('user.home') paths = [ prop('user.home'), prop('user.dir') ] }
Warning
For properties which accepts lists it is not allowed to set value using variable/property with comma separated values like
value1,value2
wrapped in []
, ie.
property = [ env('some-variable') ]
. It needs to be set in following way property = env('some-variable')