Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which files in a Java Netbeans project should be placed under version control?

I'm working on a Java Netbeans 6.7 roject with a few developers and we're using Mercurial for version control. I was wondering what I should put in the .hgignore file (ie. what files should not be added to the repository). I know I will definitely want the src, test, and lib folders in the repository and the build folder to not be in the repository. But I'm not sure what to do about the nbproject folder.

like image 573
MSumulong Avatar asked Aug 03 '10 17:08

MSumulong


People also ask

Which files of a NetBeans project are tracked by Git?

Git is used for version control of files, much like tools such as Mercurial, Subversion, CVS, and Perforce.

Where does NetBeans store project files?

Under the project name that interest you, go in the "src" folder. All your java files should be there. Save this answer.

Where is Libraries folder in NetBeans?

Select Tools > Libraries to open up the Library Manager. Click the button Add JAR/Folder and browse to the lib folder within the ImageGear for Java installation directory. Select all *. jar files in the lib folder.

What is Nbproject folder in NetBeans?

A NetBeans project is defined by the existence of the nbproject directory. In the mentioned directory, NetBeans will find information and preferences that are stored when you work on your project.


2 Answers

You must ignore the following folders: build (or nbbuild), dist (or nbdist), and the nbproject/private.

And if you want others to open it with netbeans (as you do in netbeans) you must add nbproject folder.

Though nbproject/private should be ignored, nbproject should be checked into the version control system.

If you want more information, see netbeans help on http://netbeans.org/kb/docs/java/import-eclipse.html#versioning

like image 133
PhoneixS Avatar answered Oct 18 '22 04:10

PhoneixS


If you have created these projects under an existing clone/repository, the NetBeans/Mercurial integration will already have a good idea of what to include or ignore.

NetBeans will automatically include files in nbproject that are considered to be environment independent. Files that include environmental dependencies (like directory paths) are usually placed in nbproject/private directory. You probably do not need to save those to your repo.

You may want to exclude the nbproject/build-impl.xml... it is generated when the project is opened... But, if you do not have it in your repo you will run into problems if you attempt to build the project with ant, independent of the IDE.

like image 36
vkraemer Avatar answered Oct 18 '22 03:10

vkraemer