External properties file in grails 3

前端 未结 6 1304
猫巷女王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:09

    When running from a .jar file, I found that Spring Boot looks at the current directory for an application.yml file.

    java -jar app-0.3.jar
    

    In the current directory, I created an application.yml file with one line:

    org.xyz.app.title: 'XYZZY'
    

    I also used this file to specify the database and other such info.

提交回复
热议问题