Which NetBeans projects files should go into source control?

后端 未结 5 1984
温柔的废话
温柔的废话 2020-12-07 20:21

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 co

相关标签:
5条回答
  • 2020-12-07 20:38

    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.

    0 讨论(0)
  • 2020-12-07 20:46

    You can check also
    https://github.com/github/gitignore/blob/master/Global/NetBeans.gitignore

    This open source project contains
    A collection of useful .gitignore templates

    0 讨论(0)
  • 2020-12-07 20:47

    None.

    Only source files, build scripts, and documentation that is not automatically generated (e.g. - the output of tools such as JavaDoc and Doxygen) should be checked into a repository. Things like project files, binaries, and generated documentation should not be checked in.

    The reason is two-fold. First, you don't want to overwrite another developer's project settings with your own. Second, other developers might not be using the same IDE as you (or even an IDE at all), so don't give them any more than they need to build (the project or its associated documentation) or run the project.

    0 讨论(0)
  • 2020-12-07 20:54

    As tested with Netbeans 6.8, only the project.xml, configurations.xml and the main makefile (the customisable one in the parent dir of the 'nbproject' dir, with pre/post target definitions) must be distributed via the repository. All other files will be automatically (re)generated by Netbeans (Makefile-impl.ml, Makefile-variables.ml, all the Makefile-$CONF, Package-$CONF.bash). The 'private' dir should also be ignored, obviously.

    0 讨论(0)
  • 2020-12-07 20:56

    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 (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 other users to open the project in NetBeans without having to import the project first.

    0 讨论(0)
提交回复
热议问题