But what if you have few projects with different grails versions? You can have different reasons for that, but nevertheless you need it.
Here is short tip how this process can be simplified, example for Linux (Ubuntu).
Usually I install all applications to /usr/local/. Let's try to work with two grails versions 2.0.0 and 2.1.1(latest for this period)
So after unpacking we have
/usr/local/grails-2.0.0 /usr/local/grails-2.1.1Let's create link to any version of Grails
ln -s /usr/local/grails-2.1.1 grailsNow we have
/usr/local $ ls -ld grails* lrwxrwxrwx 1 root root 23 Sep 23 15:05 grails -> /usr/local/grails-2.1.1 drwxr-xr-x 12 root root 4096 Dec 15 2011 grails-2.0.0 drwxr-xr-x 13 root root 4096 Sep 12 10:30 grails-2.1.1
echo $GRAILS_HOME /usr/local/grailsLet's use simple script to change grails version. Mainly the only thing we have to do is to reassign link /usr/local/grails to version we would like to use
#!/bin/bash #Script for changing grails version grailsVersion=$1 rootPath="/usr/local" grailsLinkPath=$rootPath"/grails" grailsPath=$grailsLinkPath"-"$grailsVersion echo stitching to version $1 #Check if directory with new grails version exists before doing anything [ -d $grailsPath ] && rm $grailsLinkPath && ln -s $grailsPath $grailsLinkPath && echo "version switched to "$grailsVersion || echo 'Directory '$grailsPath' not found'