Gradle Glam: versions - No Fluff Just Stuff

Gradle Glam: versions

Posted by: Andres Almiray on July 22, 2014

Welcome to Gradle Glam, a series on useful Gradle plugins and how to make the most out of them in your build. Hopefully I'll be able to post at least one entry per week :-D

Let's begin with a tiny but quite resourceful plugin: gradle-versions-plugin. Seasoned Grails and Griffon developers know they can keep track of their plugin dependencies by invoking list-plugin-updates command. While useful this command does not list updates for regular JAR dependencies, only framework plugins. Bummer. Grails and Griffon resolve their dependencies using a DSL inspired by Gradle. So what if there were a plugin for Gradle that would display dependency updates? Well, this is precisely what the gradle-versions-plugin does.

Inspired by the versions-maven-plugin this little plugin will calculate the delta in your current dependency graph, given the latest artifacts available on the repositories configured for your build.

Here's how you apply the plugin to your build

Say we apply this plugin to a basic Griffon 2.0.0.BETA2 project; running the gradle dependencyUpdates command yields the following information

The gradle-versions-plugin finds out that all Griffon dependencies are out of date, as by the time of writing this entry, the latest Griffon release is 2.0.0.BETA3. Interestingly enough, the plugin can also figure out if a gradle plugin is out of date, as witnessed by the shadow and macappbundle plugins for example.

See what happens when the project switches all Griffon dependencies to their latest released version

Pretty nifty, wouldn't you say?

I'd like to close this inaugural entry of Gradle Glam with my feature wish-list for this plugin

  • generate XML and HTML reports than can be hooked into the build-dashboard plugin.

Keep on Groovying!

Andres Almiray

About Andres Almiray

Andres is a Java/Groovy developer and a Java Champion with more than 20 years of experience in software design and development. He has been involved in web and desktop application development since the early days of Java. Andres is a true believer in open source and has participated on popular projects like Groovy, Griffon, and DbUnit, as well as starting his own projects (Json-lib, EZMorph, GraphicsBuilder, JideBuilder). Founding member of the Griffon framework and Hackergarten community event. https://ch.linkedin.com/in/aalmiray

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »