keep your groovy based tools up to date with macports
Some months ago (about a year I guess) I was looking for an easy way to keep my groovy and grails installations on my mac up to date. Downloading, installing each time I want to switch the version was annoying and no proper solution for my. Other *nix based OS are offering packaging tools out of the box. Debian has its apt-get, redhat their rpm packages, but macos doesnt offer such a tool out of the box. Searching the web for a macos based packaging tool guided me to macports.
The plain macports installation offers a commandline tool named “port” to handle your different port installations. A port is a software package, which is installable and maintainable via macports. These ports are based on Tcl scripts. In short these scripts describe where to get the desired software, how to build it and how to install it on your system.
But how can you get the latest groovy release working on your mac? Instead of searching for a available download in the inet, unpackaging the distribution to a favoured place on your hd and setting the symlinks, the only thing you have to do is to open your shell and type:
1 | sudo port install groovy |
After hitting enter macports does the following tasks for you:
- check if ant is installed (needed to build groovy from source, if not installed, install the apache-ant port first)
- get the latest source distribution of groovy from their download site (in this case from http://dist.codehaus.org/groovy/distributions/)
- validate the downloaded archive via md5, sha1 and rmd160 checksums
- build groovy from source via ant
- move the builded distribution to the dist directory
- patch the permissions of the executable scripts
- link the groovy scripts to your bin path
There are some gui based macports tools available for those of you who don’t like the shell (though thats hard to believe). My favourite one is porticus
Actually their are the following groovy related ports available:
- groovy
- grails
- griffon
- gradle
- gant
If you have installed a port (in my example here the groovy port. And want to update it to the latest version, you have to do run two commands:
1 2 | port selfupdate port upgrade groovy |
The selfupdate command syncs your local port tree with the one hosted at macports to get the newest entries.
If you have installed several ports (such as the one above) and want to update all outdated ports you can do this easily by running
1 2 | port selfupdate port upgrade outdated |
Besides the latest released versions, there are several ports available to keep track of milestone/rc distributions. Assume you have installed the grails port (version 1.2.2) and want to take a look on the latest release candidate (actually 1.3.0.RC1). Switching can be done via two commands on your shell:
1 2 | sudo port uninstall grails sudo port install grails-devel |
Thats it! Switching versions was never easier. The actual available groovy related developer ports are:
- gradle-devel
- groovy-devel
- grails-devel
- griffon-devel
Sometimes it can take a day or two until the latest version of these tools is available via macports, since the ports are actually maintained manually. I’m looking for a more automatic way to do this, but couldn’t find the time yet.
I know there are other packaging tools for mac available. As a convinced git user, in my opinion the approach of homebrew is awesome. But since I have to work by the way to pay my rent and still need some hours of sleep I havn’t the time for maintaining the groovy tools additionally at homebrew. any homebrew/groovy fan boys out there, who can do this? would be nice too.


