6

I want to change the location of the .grails directory. I have read about using working directories, but this is not what I want. For some reason my .grails directory gets put in the "Administrator" user folder instead of in my user folder. How do I correct this?

ubiquibacon
  • 10,451
  • 28
  • 109
  • 179

3 Answers3

7

The grailsWorkDir property controls the location. You can change the value in the BuildConfig.groovy file.

See the Grails documentation section 5.5 Customising the build:

Grails Build Properties


There is an issue with Java and the user.home property in Windows. See this SO question for more details:

Java user.home is being set to %userprofile% and not being resolved

Community
  • 1
  • 1
James Allman
  • 40,573
  • 11
  • 57
  • 70
  • Neither me nor my co-worker has a `$USER_HOME` environment variable. On his machine the `.grails` folder is put in his user folder. On my machine the `.grails` folder is put in the "Administrator" user folder. This is what I am trying to figure out. – ubiquibacon Jul 10 '12 at 15:54
  • Probably it's os-specific. What if try `echo %HOMEPATH%`? – Igor Artamonov Jul 10 '12 at 15:59
  • My `%HOMEPATH%` is the same as my co-worker's, a single backslash. – ubiquibacon Jul 10 '12 at 16:08
  • The default Windows `HOMEPATH` is **C:\Documents and Settings\** (XP) or **C:\Users\** (W7). A single backslash is unusual. – James Allman Jul 10 '12 at 16:12
  • I.T. has a lot of crazy stuff going on here. Even when I set a `%USER_HOME%` environment variable Grails STILL puts the `.grails` directory in "Administrator" user folder instead of my user folder. – ubiquibacon Jul 10 '12 at 16:17
  • A `%HOMEPATH%` of ``\`` isn't unusual when paired with a `%HOMEDRIVE%` pointing to a network share. – ataylor Jul 10 '12 at 16:17
  • @ataylor Good point. I didn't think about AD/roaming user profiles. – James Allman Jul 10 '12 at 16:26
  • @JamesA I think your answer is technically correct, but for whatever reason my PC will not comply. Rather than mess with it I'm just getting my PC re-imaged. – ubiquibacon Jul 10 '12 at 22:53
0

On Windows 7, the values in the registry for "Shell Folders" AND "User Shell Folders" in the registry path "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer" affect the user.home and in turn the location of the ".grails" folder.

Dominic Clifton
  • 1,464
  • 1
  • 9
  • 6
0

Try to setup the user.home JVM arg correctly on windows environment

kisp
  • 6,402
  • 3
  • 21
  • 19