We've gone to some lengths to try to encapsulate our development environment within a single root folder to avoid interfering between various projects with different development environments. One of the steps we've taken is to force all the working folders that get generated under c:\documents and settings\... to stay within our local root folder. One such folder is the .grails working directory.
We launch IDEA (8.1.3) from an environment in which we've overriden the USERPROFILE and HOMEPATH environment variables and set additional environment settings (including grails.work.dir) as shown below:
SET JAVA_OPTS=-server -Xms128m -Xmx512m -Xmn64m -XX:PermSize=64m -XX:MaxPermSize=128m -Dgrails.work.dir=%USERPROFILE%\.grails
SET ANT_OPTS=-Xms128m -Xmx512m -Duser.home=%USERPROFILE%
When I run the grails test-app target via IDEA's 'Tools->Run Grails Target' menu option, this works fine. The .grails folder is created in the path we expect. However, when we run the test-app target via 'Run/Debug Configurations', it doesn't honor these settings and ends up creating the .grails folder in the default, 'documents and settings' path.
I don't understand why these behave differently, and I can't figure out how to make the Run/Debug Configurations behave the same as Run Grails Target. Can anyone offer any suggestions here? Is this a bug?