We normally use Eclipse for a particular Java project, but recently I imported the project into NetBeans to use its dialog building features.
Since I'll probably come back to this, I wanted to store the NetBeans project files into version control. However, I don't want to commit files that are "mine" versus "project", i.e., files with my own settings that would conflict with another user's.
NetBeans created the following structure in the top-level project area:
nbbuild nb-build.xml nbproject <various files> configs private
Clearly nbbuild
is build output, so that won't go in. The nb-build.xml
file seems likely, as does most of nbproject
. However, nbproject/private
suggests it's "mine". Peeking at "configs", it's not clear to me if that's mine or project...
Anyone have some guidelines?
Under the project name that interest you, go in the "src" folder. All your java files should be there. Show activity on this post. On Ubuntu 16.04 using NetBeans IDE 8.2, a folder called NetBeansProjects was created in my root directory, parallel to the netbeans-8.2 directory.
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.
A JAR file containing your project is created inside the PROJECT_HOME/dist folder. If you have specified any libraries for the project (in addition to the JDK), a lib folder is created in the dist folder.
The NetBeans knowledge base article on project files & version control discusses the NetBeans project files, with loose advice about which files are project specific (i.e. can be shared via version control), and which are user specific.
Here is the section on version control:
If the project is checked out of a version control system, the
build
(ornbbuild
),dist
(ornbdist
), and thenbproject/private
folders should not be checked into that version control system.If the project is under the CVS, Subversion, or Mercurial version control systems, the appropriate "ignore" files are created or updated for these directories when the project is imported.
Though
nbproject/private
should be ignored,nbproject
should be checked into the version control system.nbproject
contains project metadata that enables other users to open the project in NetBeans without having to import the project first.
It turns out that both Thomas & Petercardona are correct, in a way. NetBeans recommends that you only import source code and/or documentation. Oh and the nbproject folder but not the *nbproject/private** folders.
From the NetBeans Knowledge Base article on importing Eclipse projects:
Version Control Considerations
If the project is checked out of a version control system, the build (or nbbuild), dist (or nbdist), and the nbproject/private folders should not be checked into that version control system.
If the project is under the CVS, Subversion, or Mercurial version control systems, the appropriate "ignore" files are created or updated for these directories when the project is imported.
Though nbproject/private should be ignored, nbproject should be checked into the version control system. nbproject contains project metadata that enables others users to open the project in NetBeans without having to import the project first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With