To set a custom path to the Grape configuration file, set the grape.config
system property, e.g. if grape.config
is set to /home/user/customGrapeConfig.xml
then Grape will use that as the configuration file.
The full list of options related to Grape configuration files, according to a Groovy Developers' mailing list thread, is as follows:
- Grape will use the value of the system property
grape.config
(if it is set) as the path to the configuration file. - If
grape.config
is not set, then:- If the
groovy.root
system property is set, Grape will look for the configuration file in the directory specified; otherwise - If
groovy.root
is not set, it uses${user.home}/.groovy/
as the Groovy root directory and looks for a configuration file there.
- If the
- If no configuration file is found to exist as per the previous steps, the
defaultGrapeConfig.xml
is retrieved from GrapeIvy's classloader (i.e. from the Groovy JAR).