Geertjan's Blog

  • September 11, 2008

Notes on Converting NetBeans Grails Support to NetBeans Griffon Support

Geertjan Wielenga
Product Manager
New project template that runs "griffon create-app" and automatically opens the newly created application in the IDE. The newly created application is based on the brand new Grails-based Groovy-Swing framework called Griffon:

For future reference, here's notes on how to convert Grails support to Griffon support, which I will do once Grails support has stabilized:

  1. hg clone http://hg.netbeans.org/main nb_all
  2. cd nb_all
  3. Then search in the Groovy/Grails modules for "grails.bat". (Don't search for "grails", because every class has that in it somewhere.) Once you've found the "grails.bat" references, you'll have found the classes that define what a Grails application consists of. Simply change "grails.bat" to "griffon.bat" and then look for the Unix declarations, which are right above or below the Windows declarations and also change those from "grails" to "griffon".
  4. Simply remove the "web-app-dir" setting, which is part of the definition of what a Grails application is, though doing this may break things elsewhere, so need to investigate this. (Need to be able to create an absolutely minimal download of NetBeans IDE, i.e., one that is Java SE only, plus the Griffon cluster, unlike Grails, which is part of the "Java Web & EE" cluster.)
  5. Make sure to also change the classes that handle the execution of the Groovy scripts, which redefine the above settings.
  6. Check the file-level Grails scripts, also check that the project structure is created correctly in the Projects window.
  7. Also change the Options window, where the location of "Griffon home" should be set instead of "Grails home".
  8. Look in layer.xml and bundle.properties files for strings that say "Grails" and change those to "Griffon". Do the same in the HTML descriptor for the project template.
  9. Change the Grails icon with the Griffon icon. (Probably 16x16 as well as 32x32.)
  10. Add some Griffon samples, JavaHelp for the Griffon support, and a tutorial explaining how to use it in NetBeans IDE.
  11. Set the Griffon home (on Ubuntu anyway) in "etc/environment", not in ".bashrc" (don't know why, but otherwise NetBeans IDE doesn't pick up Griffon home).
  12. ant -Dcluster.config=groovy build-nozip
  13. Then start NetBeans from "nbbuild/netbeans/bin".
  14. Then all should be as described here.

Then maybe create a site on dev.java.net, called "nbgriffonsupport.dev.java.net", probably.

Join the discussion

Comments ( 8 )
  • Allan Davis Thursday, September 11, 2008

    I created the project space just waiting for aproval

  • Allan Davis Thursday, September 11, 2008

    Sorry i forgot to add the URL


  • Jim Shingler Thursday, September 11, 2008

    I curse and bless you at the same time, . . . . Now I am going to have to try out NB Groovy, Grails, and Griffon support.

    Thanks for posting this.


  • Danno Ferrin Thursday, September 11, 2008

    Wow, IDE support already? Now I feel real validated integrating grails code at such a deep level. Thanks Geertjan!

  • Geertjan Thursday, September 11, 2008

    Hi all. :-) Thanks for the support. Thanks Allan for reserving that spot. Sorry Jim for burdening you with more goodness! And Danno, I reckoned that it would prove something [about Grails, about Griffon, and about NetBeans IDE, as well as the NetBeans Platform] if I were able to create the basic tooling within 24 hours of the release of [or, actually, my hearing of] Griffon. More than anything, it shows how close Griffon is to Grails! You can see from my notes above that I did little more than replace the string "grails" with the string "griffon". No actual programming at all. In fact, the whole process was more similar to branding than programming!

  • Mark Fortner Tuesday, March 3, 2009

    There's currently no project with the nbgriffonsupport name. Did you guys remove the project, or is this in one of the upcoming netbeans releases?

  • Geertjan Tuesday, March 3, 2009

    No, I have it locally on disk. Need to figure out the best way of distributing. Watch this space.

  • Dr.V.G.Kamath Saturday, May 16, 2009

    I am a biginer for Java and started the download of the first tutotail for learners in Netbeams. On starting the same for my first lesson on Hellow world I got the " Free Form Project" template and am not able to get the " Standard " templete. Can somebody tell me how to get the " Standard " template so that I can proceed with the tutorial.



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