Monday, December 10, 2007

Grails Eclipse Plugin, very basic functionality

The Grails generation utilities are designed to run from a system command line. But I keep running into folks that just don't want to go to DOS. They want a GUI. Well, someone has created an Eclipse plugin (which works with WDSc 7.0). It is available at:

Please don't forget to restart Eclipse with the clean option after copying the plugin to your Eclipse directory.
For WDSc users that means copying the downloaded org.codehaus.grails.eclipse.externaltools_1.0.0.jar file to
C:\Program Files\IBM\SDP70\plugins
Then ending WDSc and, in a DOS window:

cd C:\Program Files\IBM\SDP70
eclipse -clean

The plugin is invoked by right-mousing on your Grails project in Eclipse and selecting Grails.

It is limited to the following options:

  • Create Domain Class

  • Create Controller

  • Create Testsuite

  • Create Domain Class

  • Create Taglib

  • Generate Controller

  • Generate Views

  • Generate All

  • Create Webtest

  • Run Webtest

  • Test Application

  • Run Application

Note too that there's an issue with Run Application that you need to be aware of: While its output goes to the Eclipse console, clicking on the red square "terminate" icon does not stop the launched JVM, which prevents you from running the application again (you'll get a TCP/IP bind error as port 8080 is allocated to the JVM.)
A simple solution for this is to bring up Windows Task Manager (with Control-Alt-Delete,) click on the Processes tab, find the image name of Java (you can sort by clicking on the Image Name tab,) select java.exe, and finally click the End Process button.
If you have multiple java.exe processes listed, be careful because you may terminate a process that's doing something that you may not want to terminate.

No comments: