How do I extend the classpath used for 'grails run-app'
Posted
by
Eric
on Stack Overflow
See other posts from Stack Overflow
or by Eric
Published on 2011-03-05T15:19:14Z
Indexed on
2011/03/05
15:25 UTC
Read the original article
Hit count: 225
I have the following in my Config.groovy file:
grails.config.locations = [ "classpath:env.groovy" ]
Now, where exactly am I supposed to place "env.groovy" such that it is available on the CLASSPATH during grails run-app? The documentation here is sorely lacking.
I am able to get it to work on the pure commandline by placing "env.groovy" in $APP_HOME/etc and then running:
$ grails -classpath ./etc run-app
This seems a little hackish, but I can live with it... However, I am unable to get any such configuration working when I launch run-app using the Grails eclipse plugin (STS):
Unable to load specified config location classpath:env.groovy : class path resource [env.groovy] cannot be opened because it does not exist
I've seen related posts here, here, here, and here but the answers have been unfulfilling.
I am looking for a CLASSPATH-based solution that will work with 'run-app' in development mode (both commandline and from eclipse). I know how to set up the CLASSPATH for my deployment servlet container, so that is not an issue.
© Stack Overflow or respective owner