Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NetBeans and Java: what to add to version control?

What do I need to add apart from the obvious (src, dist) to my version control system from a NetBeans Java project directory? Can I drop the entire build directory? Should I add the nbproject directory as I'm working on the same project on a different machine as well?

I would like to drop at least the build directory because anytime the application doesn't compile I get problems with git as there's a ton of files missing which git considers as being removed.

like image 212
Makis Avatar asked Feb 19 '10 12:02

Makis


1 Answers

Note: this answer applies to NB 6.8 (which is what I am using right now) and probably also applies to most of the 6.x versions that are likely to be out there in the wild.

The short answer: Use the 'Import into Repository' menu item to do the initial check in. The IDE will check in the stuff that it thinks is necessary.

It is a bit hard to find. Select your project in the Project explorer. Open the Team menu from the menu bar. Once you click it, you will see something like:

Kenai>
------
CVS>
Mercurial>
Subversion>
______

The Import into item is a sub item of CVS/Mergcurial/Subversion.

If you you are committed to doing the check-in 'by-hand' here is a list of the stuff the IDE usually pushed into a repository:

  • src dir (and all sub files and folders)
  • test dir (and all sub files and folders)
  • nbproject dir (and all files and folders -- EXCEPT the 'private' folder and its content)
  • build.xml
  • manifest.mf
like image 174
vkraemer Avatar answered Oct 08 '22 01:10

vkraemer