Saturday, January 31, 2009

Grails, NetBeans and Microsoft Team Foundation Server

At our internal development factory at Valid we use Microsoft Team Foundation Server (TFS) as the central versioning system. As we recently started a new Grails project we had to use TFS for versioning. We also use NetBeans 6.5 as it's has some nice Grails support.

When we started I had a little bit of caution against using TFS... And we faced some really annoying problem immediatly. You have to check out each file manually before you can edit it as the files are read-only. So for example when regenerating the controller and views for a domain class you have to check them out first... For Microsoft developers this is no problem as they are using Microsoft Visual Studio and the IDE is checking out the automatically when the change the file within their IDE.

For Eclipse users Teamprise ($$$) is available, but for NetBeans there is no plugin yet to work against TFS.

After searching for a solution I bumped at SvnBridge. SvnBridge allows you to use TortoiseSVN and other Subversion clients with Team Foundation Server. It converts the calls made by your Subversion client to the API supported by TFS. As NetBeans supports Subversion I gave it try, and my first experience is really good (just tried it out 30 minutes ago). I can connect with TFS as it was a Subversion server, and it automatically checks out the files when I edit them in NetBeans. Just great!

Here some steps to setup the SvnBridge:

  1. Download SvnBridge from

  2. Unpack the downloaded file and start SvnBridge.exe.

  3. A new icon will appear in your taskbar to indicate SvnBridge is running, you can right click it to change settings. I changed the Bridge Port to 8085 as my Grails application is running on the default 8080 port.

  4. In NetBeans go to Versioning -> Subversion -> Checkout as you would normally check out a Subversion project. You have to enter the bridged TFS/SVN path like: http://localhost:8085/[]/[projectname] (e.g. http://localhost:8085/ Enter your TFS crendentials and you can check out your Grails project from TFS.

That's just it! You can now use NetBeans to enjoy working with a TFS versioning system. Don't forget all creadits go to SvnBridge.