Advanced Java Tools Power Up Groovy
One of the traditional problems with dynamic languages has always been a lack of good tool support. For Groovy, however, it turns out there are quite a few good tools available. In this article, our guest author Andres Almiray, who is also Groovy's newest committer, discusses some of the available tool options for Groovy, including options for all three IDEs, as well as command line tools. Having its origins in Java land, and being written specifically for the JVM, Groovy has tighter integration with Java than any other dynamic language that runs on the JVM. Could Groovy be the dynamic language / scripting language that you add to your Java toolbox? -Mike Urban Dynamic languages have been around for some decades. In the last couple of years they have been received again with a warmer welcome, thanks to the increase of available computer power, one of the drawbacks they faced. Groovy is one such language. It sits atop a Java Virtual Machine, providing great integration with the Java language and at the same time, powerful features found in other languages such as Ruby, Python or Smalltalk. With any new language, you will always find that developers split into two camps: those that prefer a text editor and the compiler as their only tools for coding, and those that like something else like IDEs. Groovy is no exception, and for a while it only had the simplest of tools to work with: a compiler, and interpreter, a visual interpreter and your text editor of choice. But things have been changing, especially since Groovy became gold on December 2006. Continue reading to find out more on the current state of Groovy tools. While researching about the tools I found out that some were console based and others provided a visual environment, but ultimately decided to present them in chronological order, taking as a basis the time of inception of the tool. The first tool is the Groovy Eclipse plugin, which according to Scott Hickey the current lead, began on 2004 and fell into a dormant stage, to later be awakened around March of 2006 when he took the reins. The goal of the project is to "provide a developer the same user experience with Groovy as they get with Java using Eclipse." In short terms, the current stable version is 1.0.1.20070726, it has four committers that work as unpaid volunteers. On a personal note I have used the plugin since October of 2006 and it has been a great experience so far. There is not a project site per se, but you may find more info at http://groovy.codehaus.org/Eclipse+Plugin Back in September 2005, what was the initial version of a maven plugin was committed by Jeff Geneder to the Mojo project, which holds plugins for maven outside the ASF, and later became dormant. Jason Dillon started a parallel effort when he needed Groovy integration with Geronimo. Later, in February of 2007, it moved outside of the Geronimo bounds to the Mojo project to be merged with the Jeff's previous work and be reborn after a full rewrite. Development has been very active lately with two beta releases in the last weeks. In the words of Jason, the goal of the plugin is to provide the absolute best integration of the Groovy language into Maven 2, so that Maven plugin developers and users can use Groovy instead of Java (or any other language) to enhance their builds with flexible and powerful Groovy scripting. Simple right? You may find more information at http://mojo.codehaus.org/groovy. I consider myself as a maven fan and I tried the first version of the plugin when I started coding in Groovy. The new releases provides a lot more, the maven integration is great, you can run Groovy tests, and generate groovydocs (another tool Jeremey Rayner is working at) among other things. Third in the list is Gant. By its name you have probably guessed it is Apache Ant related. In fact the main aim of Gant is to replace Ant as the primary build tool wherever Ant is used. A secondary aim is to replace the use of Maven wherever Maven is used. It began on the Groovy lists around February of 2006, but the first set of code was committed to svn on August of 2006. Russel Winder is the current lead and although there is no Gant team per se, the project has received updates and features from other Groovy committers, especially because it is used by Grails. The current stable release is 0.3.1, you may find more information at http://groovy.codehaus.org/Gant. I have also used Gant for some pet projects and I'd like the way it lets you write your build descriptor. If you have previous experience with Ruby and Rake, you know what I'm talking about. No more XML hassle. All tasks are configured in pure Groovy and you can use any Groovy sentence to mold the build according to your needs. Onward to the next tool, we find JetGroovy from JetBrains, the guys that make IDEA. Eugene Vigdorchik, the current lead, tells me there are 3 active developers. They started the project in March of 2007. Month after month they have been pursuing their goals. I thought that JetGroovy was a proprietary project but it turns out it is under ASL 2.0. You may find a list of current features, roadmap and more at http://www.jetbrains.net/confluence/display/GRVY/Groovy+Home Since JavaOne 2007, this tool has been the talk in the Groovy circles. It is amazing what they have accomplished in a short period of time. The team even committed a patch allowing Java/Groovy joint compilation to Groovy core. Expect a lot from this one. Now the Eclipse plugin team will have to play catch up. The last tool I'd like to mention is NetBeans. Geertjan Wielenga has been blogging for a quite a while on this topic. It turns out that NetBeans has what may be called a meta project named Schliemann, which is an engine that enables the declarative description of a language to be executed in the NetBeans framework. That being said, it will support other languages besides Groovy. Take a look at Geertjan's blog to read more about this interesting meta project and how he has used it to write a Groovy editor and enable features like refactoring, syntax highlighting and other goodies we have learned to love from an IDE. There is no denying that the rise of a set of tools, like the ones we have seen, for a language means that it has reached a level of maturity that poises it as a strong alternative for some and as a great complement for others. Don't let the old stigma of dynamic languages veer you off. Try them, use the tools, chances are that you will like one of them. I hope Groovy will make it into your choices. Keep on Groovying! Andres Almiray http://www.jroller.com/aalmiray/
|