When you create a NetBeans project for your source files, the IDE creates a build script, properties files, and other project metadata for the project in your project folder. See Inside the Generated Build Scripts in Chapter 3 for a full description of the project metadata files. In addition to sharing your source files, you can also check the project metadata into CVS. Other developers who use NetBeans IDE can then check out the project and start working with it immediately without having to configure their own project. This is especially important for free-form projects, for which you have to write your own Ant targets to do things like running the project in the debugger. One of the most important parts of adding projects to CVS is making sure that references to resources, such as JAR files on the classpath, source folders, and other projects, are correctly defined. If these references are not correctly defined, the project will build fine on your machine but not build or run correctly when other users check the project out of the repository. Normally, NetBeans IDE stores resource references using absolute paths in the nbproject/private/private.properties file. You should never add the /private folder to the CVS repository, as it defines local properties that are different on each machine. When a project that has resource references defined in this way is put into CVS, each user who checks the project out must specify the location of the references on his or her machine. If, however, you create a project in an existing CVS working directory, the IDE automatically uses relative links to all resources in the same CVS working directory. These relative links are defined in project.properties, which is checked into CVS and is shared by all users. As long as the projects and resources have the same relative location in the repository, no further configuration is needed.
The recommended method of creating projects that are going to be checked into CVS is therefore as follows:
If you are only checking in one project or do not want to check out the entire root of your repository (which can sometimes contain too many files to manage effectively), you can right-click an individual project and choose CVS | Import into CVS. The IDE imports the project and then checks it out again, turning its location into a CVS working directory. Resolving Merge Conflicts in Project Metadata FilesIf your project's properties are modified by two or more developers simultaneously, merge conflicts can occur when you update your project from your version control system. If merge conflicts occur in project.xml or project.properties, you should be able to resolve them manually in the Source Editor. Should a merge conflict occur in your build-impl.xml file (which itself would probably be a result of a merge conflict in the project.xml file), do the following:
|