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 http://www.codeplex.com/SvnBridge.

  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/[tfs.server.name]/[projectname] (e.g. http://localhost:8085/tfs.mycompany.com/myproject). 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.

6 comments:

Anonymous said...

Who is the goofball that decided to use Microsoft TFS for source control? Why pay for that garbage when there are so many free, open source, quality products available: Subversion, CVS, GIT, Mercurial to name a few.

Marcel Overdijk said...

As TFS was already in place for our Microsot developers it was a easy choice as we want 1 central versioning system to maintain.

Besides, we don't have to pay for it. We can use it for free as part of our Microsoft partnership.

Unknown said...

Microsoft are evil! :-) Anyway, back to reality.

Great post.. I was in the exact same situation and your post got my applets in TFS!

Anonymous said...

This is great! Thanks for the tutorial!

--b

Aaron said...

Marcel,
ARe you still relatively happy with using SvnBridge to access from NetBeans? I'm in a similar situation of needing to get NetBeans devs using TFS. You had only started using SvnBridge when you blogged this so I was hoping for an update.

Marcel Overdijk said...

@Aaron:
In the beginning it worked fall fine, but we noticed some glitches when updating files not always (most of the times it worked) the latest version was retrieved. Because of this we felt not really comfortable and stopped using it. We are now using Microsoft Team Explorer to check out files etc. Not that I'm happy with that, but currently no other solution...