I am interested in creating a Git repo for an Eclipse project (which is a Java Dynamic Web Project on top of Tomcat if that matters). Are there any sharp edges to watch out for with this? Will the checkin preserve project properties? Any suggestions on how to use eGit to easily do this?
This is a very lightweight sample app so there is no build script or tool. All it's got is one HTML file with JQuery and Mustache referring to a servlet. But it does use JSON.org Java classes.
I don't really want anyone cloning the project to have to worry about manually downloading anything else to be able to compile and run the application. For example, I used to check in third party libraries that my code used. I tried to minimize IDE specific project files though.
Personally I love the combination of Maven and Git. That way all I have to worry about are the program sources, documents and the POM. Almost no clutter!
I like checking in the Eclipse project files also, that way I can set up certain project settings (formatting, warnings, etc.) and be assured that everyone working on the project will use the same settings.
Scott Shipp wrote:I am interested in creating a Git repo for an Eclipse project (which is a Java Dynamic Web Project on top of Tomcat if that matters). Are there any sharp edges to watch out for with this? Will the checkin preserve project properties?
Yes, the checkin will preserve project properties. Assuming someone other than you is working on this project, make sure the following are true:
1) Everyone working on the project has a similar version of Eclipse. If you are on Eclipse 4.2 and your teammate is on Eclipse 1.0, that isn't likely to go well.
2) Your Eclipse project is self contained. Put jar files it uses in the same project so they go in git. And avoid absolute paths.