Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To check in, or not check in, the entire Eclipse project?

People also ask

How do I search for a string in an entire project in Eclipse?

Press Ctrl + H , should bring up the search that will include options to search via project, directory, etc. Ctrl + Alt + G can be used to find selected text across a workspace in eclipse.

How do I check for errors in eclipse?

From the main menu, select Window > Show view > Other. Then select General > Error Log. The error log is displayed, showing the following information for each error: The status of the error (for example, error or warning)


At a minimum you should be check-in the .project and .classpath files. If anybody on your team is hard-coding an external JAR location in the .classpath you should put them up against the wall and shoot them. I use Maven to manage my dependencies but if you are not using maven you should create user libraries for your external JARs with with a consistent naming convention.

After that you need to consider things on a plug-in by plug-in basis. For example I work with Spring so I always check-in the .springBeans and likewise for CheckStyle I always check-in the .checkstyle project.

It gets a bit trickier when it comes to the configuration in the .settings folder but I generally check-in the following if I change the default settings for my project and want them shared with the rest of the team:

  • .settings/org.eclipse.jdt.ui.prefs - it contains the settings for the import ordering
  • .settings/org.eclipse.jdt.core.prefs - it contains the settings for the compiler version

In general I haven't noticed Ganymede modifying files without me modifying the project preferences.


I recommend to use maven so that the entire life cycle is outside of any IDE. You can easily create an eclipse project with it on the command line and you can use whatever you want, if it's not eclipse. It has it's quirks but takes out a lot of bitterness when it comes to dependencies and build management.


In our world, we check in the entire Eclipse project and the entire parallel but separate Netbeans project. Our motivations for this were entirely focused on "when I do a checkout, I want a functional configuration immediately afterward." This means that we had to do some work:

  1. Create runnable configurations for each primary IDE (people like what they like). This includes main class, working directory, VM parameters, etc.
  2. Create useful start up scripts for all of our relevant scenarios.
  3. Create edited datasets that don't cause the checkout to take too much longer (it's a big project).

This philosophy was worth cash money (or at least labor hours which are almost more valuable) when our new hire was able to check out the project from Subversion into Eclipse and immediately run a functional system with a (small) real data set without any fuss or bother on his part.

Follow up: this philosophy of "make the new guy's life easier" paid off again when he changed IDEs (he decided to try Netbeans after using Eclipse for quite a long time and decided to stick with it for a while). No configuration was required at all, he just opened the Netbeans project in the same directory that Eclipse had been pointing to. Elapsed switchover time: approximately 60 seconds.


I only ever check in things are done by humans, anything else that is generated (whether automaticly or not) should be easy to regenerate again and is liable to change (as you've stated). The only exeption to this is when the generated files are hard (requires alot of human intervention ;) ) to get it right. How ever things like this should really be automated some how.


Try to port your project to a build system like maven. It has everything you need to get the same experience of the project on every machine you use.

There are plugins for just everything. Like the eclipse plugin. You just type "mvn eclipse:eclipse" and the plugin generates your entire ready to work eclipse project.

To give the answer to your question. Never check in files that are not being used by your project at any time in the development cycle. That means that metadata files like eclipse properties etc. should never be checked in in a SCM.


I like checking in the .project, .classpath, and similar files only if they will be identical on any Eclipse user's machine anyway. (People using other IDEs should be able to check out and build your project regardless, but that issue is orthogonal to whether or not to check in Eclipse-only files.)

If different users working on the project will want to make changes or tweaks to their .project or .classpath or other files, I recommend that you do not check them into source control. It will only cause headaches in the long run.