Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Java Projects in Git

I am trying to figure out the best way to create a java project in GIT. In particular I would like to create the git repository such that when I import from git in Eclipse, the project is automatically created correctly with all its .project settings intact and all other settings setup. I.E. if I do a git clone javaEclipseProject in my workspace/ folder then do an import on that javaEclipseProject folder it will open up the project without having to use the new project wizard.

like image 784
tompkinr Avatar asked Aug 12 '10 21:08

tompkinr


2 Answers

Add the dot-files (.project, .classpath and the .settings directory) to the Git repository. That is what we do with the Git plugin itself.

like image 137
robinr Avatar answered Oct 19 '22 23:10

robinr


I'm sure you could do that....but I know even in the company I work for, .project files are not portable from one machine to another. If you get your project building in either Ant or Maven then check it in, Eclipse, Netbeans and/or IntelliJ will be able to check out the project and build their own .project files from your start.

Moving on to the more....shall we say "religious" aspects of the problem, personally I like the way Maven or Ivy or "insert many other Ant++ build tools here" will go ahead and find any dependencies that you might not have already and download them for you. I'm sad to say, but in the times I've used them, Eclipse actually has the least easy to use Maven support though, I don't use IntelliJ, but the snobs.....I mean co-workers I have that do say integration is seamless, and Netbeans it just flawless for Maven.

YMMV of course.

like image 37
mezmo Avatar answered Oct 20 '22 00:10

mezmo