Sometimes it is required that multiple Grails projects, hosted on a different Grails version, run simultaneously. In this case, while fixing bugs, you are required to run the application after switching the Grails version each time.
To handle this scenario, I wrote a utility shell script “runGrails” to use a particular version of Grails while running the scripts like run-app, test-app etc. The shell script contained these two lines:
export GRAILS_HOME=/opt/grails-$1 $GRAILS_HOME/bin/grails $2
This script was put in a location coming under the “PATH”. It is assumed that the different versions of grails are under directories named grails-<version> under /opt/.
Now, to run different projects, we can call the script as:
runGrails 1.3.1 "-Dserver.port=8082 run-app"
which will run the project with grails version 1.3.1 at port 8082.
PS: This works on *nix systems.
Hope this helps.