X

Geertjan's Blog

  • October 31, 2007

New Version of Groovy Support in Plugin Portal

Geertjan Wielenga
Product Manager
If you go here in the Plugin Portal, you'll find I've uploaded a new ZIP file, called groovynbms-4.zip (the previous one was called groovynbms-3.zip). In other words, when you click the Download button, you will get groovynbms-4.zip. This time you will have five modules instead of three and this time each of them has a description, as indicated here:

Please make sure to be using NetBeans IDE 6.0 Beta 2. If you're using something later (like a daily build), it might still work (and it probably should still work), but no promises. Once you've installed, you'll find a new category in the New File wizard, with various Groovy file templates:

Once you've created a Groovy file template, you'll see it has the same icon as Java source files. There's also support for the Java parts of Groovy, as indicated below:

The Groovy parts of Groovy are not supported by code completion. In other words, for example, there's no code completion for Groovy-specific things, just Java-specific things. (Where Groovy doesn't support something provided by Java, you'll still find code completion, etc, working for you, you'll just end up with compilation or runtime problems later. But these situations should be minimal.) You'll also find Java code templates working for you (e.g., type ir, press Tab, and then you'll have import). Plus, you'll find the extension to the Java Application project type for running groovyc and Groovydoc from Ant, as described in an earlier blog entry. And when you look in the Library Manager, you'll find the Groovy Library there (had to be a snapshot of 1.1, otherwise the Groovydoc script won't work).

Sometimes the Run menu item, in the editor, is disabled. Especially when you've first started up the IDE or first opened the editor. If that happens, you need to do something in the editor (e.g., add some code and save it) to enable the menu item. Again, no need to download the Groovy installation, because everything should be handled for you by the JSR 223 implementation. Feedback welcome.

The sources are available here: http://nbgroovysupport.dev.java.net/. Anyone is welcome to take them and add to them.

Join the discussion

Comments ( 8 )
  • Ranganath.S Wednesday, October 31, 2007

    thats awesome.. thanks alot!


  • Charles Anderson Thursday, November 1, 2007

    Great work, but I'm having one little issue so far.

    Right-click->Run is disabled until I modify the editor. I open a groovy script, right-click on it and run is disabled. I click in the editor pane, hit space, ctrl-z (so no actual changes) then I can run.


  • Charles Anderson Thursday, November 1, 2007

    Ok, I'm stupid, I didn't read until the end...I just got the link and went from there.


  • Geertjan Thursday, November 1, 2007

    That's right. See the known issues on the plugin's page. I've encountered the same thing. Not sure how to fix it.


  • Geertjan Thursday, November 1, 2007

    OK, no probs. :-) Any special wishes for the plugin? I mean, if there's one thing you'd like the next feature to be, what would it be>


  • Stefan Friday, November 2, 2007

    Fantastic! Thanks!

    Is it possible to use the debugger in Groovy code? I'm not able to set any breakpoints.


  • Geertjan Friday, November 2, 2007

    Yeah, what you need to do is set the breakpoint in a Java class, and let the Java class instantiate the Groovy class. (I have described that somewhere recently in this blog.) You also need to compile the Groovy script. Then when you debug the Java class, the Groovy script opens at the point where the Java class instantiates it. At that point, you can step through the Groovy script. So, it takes a bit of work to set up and it does mean that you need a Java class to kick off the debugger.


  • Stefan Saturday, November 3, 2007

    OK, I see. Thanks for the hint!


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.