Scott and others - any input on which IDEs or editors are best for Groovy and Grails? What do you use? I know IntelliJ has a plugin which I've jsut downloaded, and I'm pretty sure there's one for Eclipse. Any preferences?
I've used the IDEA plugin and while the groovy bits work well its been hit and miss with the grails plugin. I can't think of any specifics off the top of my head and it's been a few months since I've looked at it but I just remember having issues with many of the features like kicking off generator scripts and what not.
A related question I'd add: for Java, we (here at JavaRanch at least) usually recommend that people first learn the basics without an IDE, because it hides too many details that you really should learn. Do Scott and others think that anything like that hold true for Groovy/Grails?
Forgive me for jumping in, but I also use IDEA with the JetGroovy plugin and it is working very well for both Groovy and Grails. Some of the generate scripts were not directly supported in earlier releases but they are in the latest. Even then it was easy to jump out to a shell and run those scripts.
The syntax highlighting, code completion (to an extent), refactoring and debugging are a huge productivity boost but the IDE does not really do anything for you that you would need to learn to do yourself. Much of what Java IDEs do in that regard is boilerplate code. And I agree that when you need to work with that stuff yourself and you're used to your IDE doing it you can get stuck. But with Groovy and Grails there is so much less boiler plate code so that issue all but goes away.
I started playing around with Spring's Scripting support using Groovy tonight so I got to use the plugin quite a bit while creating my Groovy code. Just some notes:
When you try and use a class in a groovy file that needs to be imported you don't get the normal notification. You can still alt+enter on the class and then you get prompted for the correct action but auto import on alt+enter is no longer available.
When creating a new groovy file if you choose script, even though you are in a package, the package statement is not generated for you. If you tell IDEA you want to create a Groovy class then all is well. This isn't good or bad. Just something to be aware of.
Autocompletion is so-so. Yes, I am aware that Groovy is somewhat of a dynamic language however something as simple as accessor methods, IDEA should be aware those are automatically available and allow autocompletion for you. On the other hand it does autocomplete for message.message and since in Groovy that is the same as message.getMessage() I suppose its fine. But I still think IDEA should be smart enough to know that getMessage() is available.
I can't find a way to tell IDEA to execute scripts as scripts. IDEA compiles them to bytecode prior to executing. Is this a big deal? Probably not and the code executes faster but seems unnecessary if I could turn it off.
That's all I came up with so far. If I find anything else I will post it here. [ February 19, 2008: Message edited by: Gregg Bolinger ]
I created a class in a package and I needed to move it to a different package. I used IDEA's refactor and moved it to the new package however the package declaration in the groovy file didn't update to reflect its new home.
When implemeting an interface or extending an abstract class with abstract methods, IDEA doesn't warn you about required methods that need to be implemented. You can still alt+insert to see what needs to be done but until you compile/run your groovy code you won't know about it.
How about a good plug-in for NetBeans or Eclipse. Mostly I'm looking for a worthwhile debugger.
I tried one a few months ago (Coyote, I think) and I could set a breakpoint in Java code that was executing a Groovy script and step into the Groovy code, but it didn't let me set a breakpoint in the Groovy code itself - which is very frustrating.
Any recommendations for either browser are welcome. Thanks!
SCJP, SCJD, SCEA 5 "Any sufficiently analyzed magic is indistinguishable from science!" Agatha Heterodyne (Girl Genius)
Yeah, I'm also looking for a good plugin for NetBeans. I know there's one out there, but so far it only does some simple syntax checking and some other simple stuff without any Grails support. Hopefully the NetBeans team has already had a plan to build this plugin.
SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
Neither NetBeans nor Eclipse are not there yet as far as the Groovy support is concerned. With all the buzz around Groovy and Grails, shouldn't be long before we see very good groovy support from these IDEs
I don't use netbeans at all until it becomes a little more flexible on project layouts.
Eclipse is my main IDE at work (we have Rational App Dev licenses, but it stinks). Groovy support in eclipse is poor. It is difficult to get the groovy plugin to pickup GSP files. There is no source formatting, completion is hit or miss but syntax highlighting does seem to work ok. I really miss the source formatting.
I have used Idea 7 with Groovy and Grails. As Dave Klein mentioned, JetGroovy is working pretty well in the current release. It's a little awkward to run the generate scripts in idea. Having a terminal handy is still really helpful.
I found TextMate (Mac-Only) to be one of the best interfaces to work with Ruby on Rails, and there are some textmate bundles for groovy. Groovy TextMate Bundle I imagine the grails support would work similar to RoR. TextMate's appeal, from what I can tell, is that it closely ties the file system and the editor. At least it feels a little more intuitive.
Disclaimer: my experience is based on a few weeks of trial use for Idea and TextMate. I still use a terminal with vi. If I did purchase an IDE, it would probably be Idea (I feel a little guilty for being a huge fan but not budgeting for this). Honestly, I put my fun money towards books and a good computer every few years, for now.
Originally posted by Pratik R Patel: I have a license for IDEA and was excited to use it for Grails/Groovy development - but I find it to be sluggish. [ July 06, 2008: Message edited by: Pratik R Patel ]
I'm not sure what sluggish looks like. I'm running the Groovy/Grails plug in using IntelliJ 7.0.3 and it's anything but sluggish. The integration between Groovy, Java, Spring, and Hibernate is fantastic.