views:

99

answers:

2

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.

+1  A: 

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.

mezmo
What plugins create .project files that are not portable between machines? We have the .project files of all our projects in version control and never had any issues.
nhnb
I would also like to know that.
Thorbjørn Ravn Andersen
Not plugins, mainly its dependency issues. If the file paths or library paths I have on my system don't match those on yours, I can't just check things out with strictly the base Eclipse config and just hit compile and go. If you're using some open source jar I've never even heard of, and IF you don't also check in all the dependencies, which we don't, why do I need forty thousand copies of log4j in "source" control anyway?? Like I said above, its more about the way you like to work, which I consider a "religious" issue. ;)
mezmo
+1  A: 

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

robinr