I thought take a few minutes and jot down some of how I work with Grails, Groovy, and associated tools.
A Little Groundwork Before We Begin
So my goto tool for setting up a new environment (system) to work on with grails is to ensure that a JVM is available to me. Typically I use a java-7 based jvm, but I haven't had any issues using the OpenJDK one vs. the Oracle one. That's not saying there aren't some issues, just that they haven't bitten me.
First Steps
Once the JDK is installed and available I install GVMTool for convenience. You can just download and install grails directly, but since I have several grails projects involving different versions of grails, I find the management features from gvm to be too handy to ignore.
GVM actually allows you to install a fair number of other frameworks, but for today we'll just focus on grails.
GVM works much like RVM (that inspired it) in that it allows you to keep different versions of grails available without having to manually juggle directory paths or make crazy changes to your configuration.
So, to kick things off, you can just run
gvm install grailsand it will install the most recent version of grails into a set of private directories and ask you if you want to set that into your path.
From that point onward it's just standard grails, and that rocks!
A Few More Commands
If you have an older project you can install specific versions with
gvm install grailsVersions as far back as 1.2.0 are available.
Need to know what version you have installed?
gvm list grailsis your friend. Installed versions are marked as well as the version that is currently installed.
Now that you know what version you're on, and you have the version you need installed, how do you switch? Easy,
gvm use grailsand you're ready to go.
Summary for GVM (TL;DR)
GVM makes managing grails (and other projects) dropdead simple.
-
gvm install grails
-
gvm list grails
-
gvm use grails