Monday, November 16, 2009

Running Grails Commands in NetBeans

NetBeans has some great support for developing Grails applications. We can run an arbitrary Grails command by right-clicking on the project and select Run Grails Command... from the pop-up menu. NetBeans opens a dialog where we can type in the command we want to use with parameters if needed.

To get quick access to this dialog we can assign our own shortcut key combination to the command. We go to Tools | Options | Keymap. In the Search field we type run grails and we get the Run Grails Command... in the Actions list. We click on the ... button to assign our own shortcut key combination (I choose Ctrl+Shift+G).

We close the Options window and now we can press our shorcut key combination and we can run Grails commands immediately.

2 comments:

Anonymous said...

Don't you have problems with imports from classes provided by plugins?

I often hear people rave about Netbeans and I then find it unable to discover plugins properly and I wonder how anyone can use it for real grails development.

mrhaki said...

@Anonymous: I don't have that problem. I have for example installed the Quartz plugin (right-click on project -> Grails plugins...) and in my controllers I can access all quartz classes, which I couldn't before I installed the plugin.