Reputation: 4567
I've seen questions and answers about how to specify external .groovy and .properties files for Grails config that are outside of the WAR file using grails.config.locations, but we need external config that isn't on the server on which the container (Tomcat) is running. (It does have a local FS, but it is not persistient and is identical for all deployment environments - hence the need to override it external to the WAR, container and server).
So, can I use http: URLs for grails.config.locations ?
Upvotes: 3
Views: 862
Reputation: 4567
Yes. The following works:
Add this in Config.groovy and pass PARAM1 using -D to the JVM to specify the external URL for the config file.
grails.config.locations = ["url:" + System.properties["PARAM1"]]
Upvotes: 4
Reputation: 3560
I am not aware of any built in functionality that would allow you to specify URL for grails.config. However, it seems like something that you could implement yourself:
I haven't tried it but seems like it would work.
Upvotes: 1