Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get values from properties file in grails?

Tags:

grails

How to get values from properties file please? and where should I put the file ?
Thank you

EDIT : I'm using grails 3.1.5 And I'm trying to get properties from a job class (quartz)

like image 716
hereForLearing Avatar asked May 19 '16 09:05

hereForLearing


1 Answers

Either keep your properties directly in Config.groovy file.

Or you can create a .properties file to keep properties and add this file in Config.groovy

grails.config.locations = [ "classpath:grails-app-config.properties"]

and access it anywhere in application using

grailsApplication.config."propertyName"

like image 174
Anshul Avatar answered Sep 28 '22 06:09

Anshul