Site Navigation

Dec 12, 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.

Post a Comment

Favorite Links Feed