When starting projects, should I include .project & .classpath?

When I submit a web application for versioning, should I also include the .project and .classpath files? I don't think it should make any difference, since other users who are using the project should have the same project settings?


source to share

5 answers

This is the question that drives people crazy with debates that never end. You basically have two camps:

  • Put the source code into source control only. Each developer chooses their own IDE and manages their own project configuration. Setting up your IDE after getting the source code from the repository will be a daunting task. If one of the developers changes a project's dependencies, they must explicitly report it so that all other developers update their project configurations. There are some tools out there that try to fix this problem, like a Maven plugin that will try to generate Eclipse project metadata from pom.xml, but they all have their limitations. Groups that do this prefer the purity of not limiting developer choices in the IDE by making Eclipse projects work only as a team.

  • Standardize on Eclipse. Place all the Eclipse project metadata in the original control. This includes .project, .classpath and all the contents of .settings. Basically, the only thing you don't need in your source control repository is content that is marked as fetched in Eclipse. You can check this in the right-click-> properties. With this approach, developers can start coding as soon as they get the project from the control source. No additional configuration is required. Also, when one developer changes the project configuration, the rest of the team will see the same change the next time they sync.

Choose the approach that works best for your team.



For ClearCase, including .project

and .classpath

can be important if you are using IBM ClearCase plug-in for the Eclipse .

This plugin will perform better if it can rely on those (versioned) files that are there next to the sources (as opposed to being in the Eclipse workspace, which does not necessarily contain the specified sources).



In general, nothing is generated into the repository. These files are usually generated by IDE or maven. However, sometimes you may need to click a button or execute a command to get the ones that were generated.



i will include them.

The file .project

has information about the plugin (e.g. maven, ant, pdt, wst, aspectj, findbug ..). This is important if this is not a simple Java project.


contains the classpath. this is required if you are using jar files.



I would say that all files - including .project and .classpath - must go to the original control so that everyone in the command has exactly the same setup.



All Articles