Groovy and Grails in NetBeans 6.7 M3

The last milestone of NetBeans 6.7 is out. What has been improved and fixed in Groovy and Grails area? Read below.

The biggest change is that we changed our parsing and indexing infrastructure. This should unify the code across different languages and solve several Groovy and Java integration issues. As you can imagine this is quite a big change that does not affect Groovy only. So if you are going to use M3 or daily builds please let us know any bug or incorrect behavior.

The first visible enhancement (as opposed to previous which should be ideally invisible) is the Grails 1.1 support. Now you can install and uninstall plugins while seeing the proper code completion, relevant parsing errors etc.

This should work even in case you override some of the default settings in BuildConfig.groovy. For this purpose there is Resolve Plugins action in context menu of the project. You need to execute this action only if you are using non default values and you've opened the project for the first time or you've changed the values recently. The reason why this is not done automatically, although it would be possible, is that BuildConfig.groovy is in fact a script that has to be evaluated. The IDE can't be sure what are the side effects of such script so we decide to choose the conservative way of conscious action.

Perhaps we could add a download of missing plugins as a part of this action. It would be useful after VCS checkout. What do you think? Let me know.

Another related change is overall context menu cleanup as you can see on the following picture.

Now you can also assign shortcut (although there is none by default) to Run Grails Command action. This will certainly make you very effective. I think the usage of shortcut and command dialog is even faster than the console typing.

Another important improvements were made in wizards. You can now configure your Grails installation directory directly from the project wizard. This is especially useful for new users and when using the fresh IDE installation.

Artifact (domain, controller, service, etc.) wizard was improved as well. It was cleaned up and fixed so now you can finally easily create the artifact including the package easily.

In previous releases you might run into problems while stopping the Grails application on Windows from the IDE. This was fixed with great help from Lloyd Meinholz. So running and stopping the application from the IDE should be quite comfortable now.

Also many other minor fixes were made. For example dynamic finder code completion should be now properly displayed even when the domain class is not in the default package.

Unfortunately, as always, not all interesting changes made it to M3. Several performance improvements were made just after M3. Thanks to Göran Ehrsson for valuable reports. Also field code completion is now more accurate in daily build and Groovy file navigator was improved and fixed. As this is the last milestone and stabilization period starts the daily builds should more and more stable in future. In case you are interested in the latest features and fixes and/or you want to help us you can download daily builds from the NetBeans dowload page. If you even want a couple of minutes old builds with Groovy features integrated you can get a build from continuous build server.


Where is the step by step debugger? Isn't a debugger the #1 differentiating feature between an idea and an editor? Oh well back to Textmate I suppose.

Posted by Keith Thomas on April 02, 2009 at 02:24 PM CEST #

Keith: From the command line, run "grails-debug run-app" Then from within NB, go to Debug>Attach Debugger. Enter port 5005 and hit OK. Any breakpoints you have set will trip as you hit them. Step by step debugging.

Posted by Joey Gibson on April 02, 2009 at 05:25 PM CEST #

It already has step by step debugging? Everything I had read said it did not have the feature and that step by step debugging would be in M3 so I never bothered even trying it. I will now give it a go. many thanks!

Posted by Keith Thomas on April 02, 2009 at 06:25 PM CEST #

Shame :) I get 'verification failed' every time I try and execute the dmg that downloads the smallest bundle for OS X. Going to try another bigger bundle, I wonder if it matters which one I take if I need Grails support?

Posted by Keith Thomas on April 02, 2009 at 06:27 PM CEST #

Hi Keith,
you can either use the small bundle and install groovy support from update center (plugins dialog) or you can download Java bundle.

The debugger is there. What I would like to improve before enabling it to be available out of the box is support for watches. On the other hand for bug hunting it works fine for me.


Posted by Petr Hejl on April 03, 2009 at 04:10 AM CEST #


I'm newbie to groovy and grails and I congrats every effort to improve NetBeans in that direction. But I have one question , is it possible to run groovy scripts from NetBeans like right click -> Run file .
And another, it would be nice to have Groovy Project also not only Grails Project.

Posted by Patrik on April 06, 2009 at 08:08 AM CEST #

Hi Patrik,
yes it should be possible with any 6.7 build. Well we do not have a specific groovy project as groovy itself does not define a project. Just create a Java project and develop with groovy classes (create groovy class or script). We didn't want to reinvent the wheel.

There is a Grails project because Grails define the project structure.

Let me know in case I can help you with anything else.

Posted by Petr Hejl on April 06, 2009 at 08:26 AM CEST #

Hi Petr,

thanks for clarifying it to me. As I notice 'Run File' doesn't work in Grails Project but it works in Java Project. Keep up the good work .


Posted by Patrik on April 06, 2009 at 08:50 AM CEST #

My dear, when do you release a versions whith contains a Degugger for Grails.

I am looking forward to hearing from you.

Posted by Danilo Santos on April 08, 2009 at 08:54 AM CEST #

Debugger is there (java aware). You have to connect it manually as Joey described. If you want to speed things up you should test it and report bugs so we can stabilize it. Or you can even contribute the code.


Posted by Petr Hejl on April 08, 2009 at 09:07 AM CEST #

I don't know how to find this feature, could you suggest me where I found one tutorial which explains how to use a debugger for Grails on Netbeans?

Posted by Danilo Santos on April 08, 2009 at 11:14 AM CEST #

Danilo, from my previous comment:

From the command line, run "grails-debug run-app" Then from within NB, go to Debug>Attach Debugger. Enter port 5005 and hit OK. Any breakpoints you have set will trip as you hit them. Step by step debugging.

Posted by Joey Gibson on April 08, 2009 at 11:17 AM CEST #


I've just upgraded but still having issue with stopping a Grails appl from the IDE.

It stopped when I tried the first time but won't do it since.

Any ideas ?


Posted by Jason Kim on April 15, 2009 at 01:54 AM CEST #

Hi Jason,
thanks for your report. There were couple of issues recently: I believe this was already fixed. Could you try the latest daily build (


Posted by Petr Hejl on April 15, 2009 at 03:33 AM CEST #

Hi Petr,

I've upgraded to 200904151401 dev build and yeah it works now.

Thanks for your help.

One thing I've noticed with this build is "Go to File" menu does not work for GSP files anymore. I am sure it was fine with V6.7 M3.

Btw, good to see that the Grails is getting more and more support on the NetBeans.

Posted by Jason Kim on April 15, 2009 at 07:45 PM CEST #

Hi Jason,
broken "Go To File" is a regression ( It was fixed yesterday, so the fix is on the way to daily build. I can let you know once it is there.


Posted by Petr Hejl on April 16, 2009 at 03:41 AM CEST #

I have installed the spring security plugin and NB can't find the Secured class in the import statement. Grails runs fine but it always shows errors in NB. Do you have any insight into this problem?


Posted by Dru Devore on July 15, 2009 at 06:48 PM CEST #

Hi Dru,
we have found and fixed this bug recently. Should be fixed in trunk (and upcoming) 6.8 M1.


Posted by Petr Hejl on July 16, 2009 at 12:24 AM CEST #

This is awesome I look forward to using it this is a wonderful plugin. One more thing, I don't know if this has anything to do with the plugin or not but if you have the following line in a gsp

<g:lib test=lkaj">

If you then go to just after the "=" and enter a " it will give you a double ""

<g:lib test=""lkaj">

which is not correct in that situation. Don't get me wrong. I am not complaining I like this plugin.

Posted by Dru on July 16, 2009 at 04:53 AM CEST #

I think NetBeans is great for the Grails project I am working on. However I am having trouble with the step-by-step debugger.

I try to follow to the steps given above, i.e:

- Set breakpoints in my Groovy files, as required
- Run grails-debug run-app from the command line
- Attach the debugger to port 5005 using Debug/Attach Debugger.. in NetBeans

The debugger appears to attach, and I get the Debugging view in NetBeans. I then try to run my application from a browser, but it completely ignores the debugger. It runs past all the breakpoints without stopping at any of them.

I notice that there seem to be many debugger threads visible in the Debugger view. Should I set one to be the current one using the "Make Current" one, and if so how do I know which one?

Posted by Gary Mann on August 31, 2009 at 03:12 AM CEST #

Hi Gary,
this seems to be quite strange. I can't reproduce it do you have more details? Does it occur for simple new Grails app? Can you file a bug for that?


Posted by Petr Hejl on September 09, 2009 at 10:02 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed

Petr is a NetBeans software engineer responsible for the Groovy & Grails support.


« July 2016