Grails: How to Easily Check if Your Plugins Need Updating

The Grails plugin ecosystem is quite extensive.  There are currently 240+ plugins available in the repository.  If you're like me, you use many of them in your projects.  One of the issues I've always had is how to easily determine if there is an update available for one of my installed plugins.  Here's a script to do it for you.

Robert Fletcher over at the Ad-Hockery blog, wrote a nice little script appropriately named "CheckPluginVersions".  It's publicly available on GitHub at http://gist.github.com/130031.

Here's how to use it:

  1. Download CheckPluginVersions.groovy from http://gist.github.com/130031
  2. Copy CheckPluginVersions.groovy into the scripts directory of your Grails application.  The scripts directory is a toplevel directory, at the same level as the grails-app directory.
  3. At the command line, cd into your project's home folder and type 'grails check-plugin-versions'.  You should see a nicely formatted report returned to you, similiar to the one shown here:

Plugins with available updates are listed below:
-------------------------------------------------------------
<Plugin>            <Current>         <Available>
fckeditor           0.9.3             0.9.4
mail                0.7               0.7.1

There is no longer a need to manually sift through the results of the list-plugins command and compare them to your projects' installed plugins.

What a timesaver.  Thanks Robert Fletcher!

Comments:

Interview

by Jake Rocheleau on July 21, 2009 at 4:04 PM CDT
Impressive article. I have a web 2.0 blog about stuff like this, and I'd love to have an interview with you if you'd be interested. Check out my blog and let me know - http://www.insidethewebb.com/

better location

by Lee Butts on July 22, 2009 at 8:30 PM CDT
hi Dean, an even better place to put the script is ~/.grails/scripts which makes it available for every project. cheers Lee

Should be added to Grails core

by Marcel Overdijk on July 24, 2009 at 12:00 PM CDT
This script should definitely be added to Grails core!

now added to grails core

by Robert Fletcher on November 7, 2009 at 8:27 AM CST
I just committed the script (renamed to ListPluginUpdates) to the Grails core.

and then...

by Fletch on June 29, 2010 at 8:28 AM CDT
And then what? grails uninstall-plugin, grails install-plugin? It seems a bit funny. Why isn't there "grails upgrade-plugin"? Just used the core version of your script by the way, nice.

.. and then ...

by BernGP on August 20, 2010 at 2:19 PM CDT
It seems we need an additional script added to the core to update plugins, this script though needs to take into consideration SNAPSHOT versions such that it forces Ivy to download the SNAPSHOT again regardless of the cache...
Subject*
Name*
Comment*