External properties file in grails 3

前端 未结 6 1289
猫巷女王i
猫巷女王i 2021-02-08 00:32

I need read configuration from a external file properties in grails 3. In grails 2.x I link the file with:

grails.config.locations = [\"classpath:config.propert         


        
6条回答
  •  情深已故
    2021-02-08 01:07

    You can use
    
    def cfg = new ConfigSlurper.parse(getClass().classLoader.getResource('path/myExternalConfigfile.groovy'))
    

提交回复
热议问题