Showing posts with label subversion. Show all posts
Showing posts with label subversion. Show all posts

Wednesday, 12 December 2007

Using Subversion with Netbeans 6

The other thing I did last night was to experiment with Netbeans 6.0 and Subversion. I wanted to figure out how it interacts with a Subversion repository.



For a typical Subversion project, by convention you want to setup 3 directories:


  • branches - This directory is used for branching your code so development can occur in more than one place in your repository.
  • tags - This is essentially a snap shot directory. Whenever you provide a release, you make a snapshot here. That way, the code's state is preserved for all time.
  • trunk - This is where all the main development takes place. You checkout and commit your code in this directory.
Well, Netbeans 6, does not setup these directories for you when it writes your project to the repository. So, if you want to follow convention, you need to set them up first.


I was also not sure how Netbeans 6 would handle an Enterprise Java project that has a main project, and potentially, 3 more: an ejb project, an application project, and a war project. Does Netbeans 6 include the code for all 4 projects when you do an import? Or, do you have to setup separate set of directories for each project?



Well, I first tried it with an old project to see what happened. I opened the main project and did an import. Only the main project was imported. "What a pain in the rear end!" I think to myself. Not good. As this implies I would need to setup a set of directories for each subproject.



But upon further testing I discovered that if you have all of the projects open when you do the first import of the main project, it picks up the other three subprojects. Yay!!!! That's how it should work. All 4 projects are included in the same trunk directory. So just remember, make sure you have all subprojects open when you do your first import. That way, Netbeans will automatically include them.

Getting Subversion for Netbeans on Windows

I'm working on a JPA project a work and now that I'm getting into the more advanced stages of the project I wanted to put my code under version control. Being a a fan of OS X, Linux, and Solaris, I'm a bit of a command line weenie and prefer using the command line version of Subversion. However, I was having very little luck finding a command line version for Windows. As I was about to install TortoiseSVN, an SVN plugin for Windows Explorer, I started playing with the Subversion support in Netbeans 6.



When I tried to do anything from the Netbeans 6 Subversion menu, I got an error stating that Netbeans needed a command line version in the system path to use this feature. Much to my delight I was pointed to this site:
http://netbeans.open.collab.net/
which contains the latest precompiled versions of subversion clients for a number of OSes. I downloaded the Windows version and installed it. Instant Netbeans command line client for Windows. Thanks Netbeans team!!!! :)