Gravy is a simple Grails version manager for Windows OS.
When it comes to managing multiple Grails versions within a host, *nix developers enjoy the benefits of the GVM tool. Those using Windows OS are however stuck with rather mundane task of tweaking system variables back and forth. It is true that GVM supports Cygwin, but Grails shell still has some rough edges in this environment (at least based on my experience, anyway, your millage may vary). In addition, even Cygwin is often not an option for corporate Grails users, who are also those most likely running Windows OS.
Gravy has no intention of competing with GVM and its rich functionality set. Instead, it only addresses the task of switching locally present Grails versions within the active command shell.
Create a common home directory for all Grails versions, e.g.
C:\Grails. Create a system variable
GRAILS_ROOTthat refers the full path to this directory (without the trailing backslash), e.g.
Unpack any desired Grails version into a separate sub-directory within the common home. The sub-directory name should correspond to the Grails version within, e.g.
C:\Grails\2.2.0. Note that you can add or remove a version any time.
Optionally, configure one version as default. This is useful when majority of projects are using one Grails version while others are needed for occasional maintenance tasks. Create
GRAILS_HOMEsystem variable that refers the full path to the specific version sub-directory, e.g.
GRAILS_HOME=%GRAILS_ROOT%\2.2.0. Add the path to the executables to the
PATHsystem variable. e.g.
Download and put
gravy.batscript somewhere within the system and add the respective directory to the
PATHsystem variable, if not already there.
Launch a new DOS shell and run
gravy listcommand. It should show the list of available Grails versions.
gravy helpshows brief setup and usage instructions.
gravy listshows available Grails versions.
gravy use 2.2.0enables the specified version (e.g. 2.2.0 in this example) within the current shell.
When a new DOS shell is started, default configuration always applies. There will be either default Grails version enabled (as per the settings in step 3 above), or no Grails at all.
Gravy changes (or sets, if does not exist) both
GRAILS_HOME and Grails
\bin link in the
PATH temporarily within the scope of the running shell. If needed,
use command could be run unlimited number of times (i.e. changing active versions back and forth) as the values are replaced instead of just added.
IMPORTANT: Gravy will not work properly if there is Grails
\bin path specified directly within
PATH variable without corresponding
GRAILS_HOME setting as it has no point of reference for pre-existing setup.