20

I'm using NetBeans to develop J2EE web service. NetBeans create a directory called nbproject inside my project directory. I'm wondering if I should put this directory under source control. I think it is required to build the project without NetBeans.

svick
  • 236,525
  • 50
  • 385
  • 514
Ido Ran
  • 10,584
  • 17
  • 80
  • 143
  • 1
    possible duplicate of [Which NetBeans projects files should go into source control?](http://stackoverflow.com/questions/1267403/which-netbeans-projects-files-should-go-into-source-control) – vkraemer Jun 28 '11 at 19:23

3 Answers3

50

This is usually not required. Think of it this way: If I was to check out your project but happened to be using a different IDE, I would not require your nbproject directory. In other words: This directory is machine specific, not project specific. Hope this helps.

Thomas Landauer
  • 7,857
  • 10
  • 47
  • 99
Deviland
  • 3,324
  • 7
  • 32
  • 53
  • 7
    This should be the accepted answer, seriously. nbproject, like Eclipse project files should not be versioned. They are machine specific. – Eric MORAND Sep 29 '13 at 09:10
8

The nbProject folder contains all the netbeans metadata about your project. When you go Project -> properties all the settings (and others) that you find there are stored in the nbProjects folder.

EDIT: This has been answered in another question, and the answer there is more complete and accurate

In short you should include nbproject, but not nbproject/private/. Add */nbproject/private/ to your .gitignore file.

eskwayrd
  • 3,691
  • 18
  • 23
Tim Sparg
  • 3,294
  • 2
  • 27
  • 40
  • 1
    Guys, correct answer is below. Project's files are something private to developer. Each developer can use it's own editor/IDE/other and their settigns shouldn't be in project. – gaRex Oct 11 '14 at 12:11
2

If you are building your project with Maven or Gradle you should definitely exclude the folder from the VCS.

Evgeniy Mishustin
  • 3,343
  • 3
  • 42
  • 81