Michael W
Michael W

Reputation: 3555

Handling .project files and different eclipse setups in SVN?

.project files contain references to the project natures used in the project.

These project natures are dependent on the plugins installed on the local developers machine.

So, should this file be excluded from SVN?

Will nautures unknown to other developers cause problems?

Thanks

Upvotes: 0

Views: 252

Answers (2)

Bananeweizen
Bananeweizen

Reputation: 22070

It depends on your situation.

Indications for putting them under version control:

  • you are talking about a team in a company context. You should be able to enforce a common developer environment, unless you also have an organizational issue.
  • everyone is using Eclipse
  • you want to make it more easy for newbies to just check out the project as such from SVN (without recreating it as a new project)

Indications for not putting them under version control:

  • the people (or IDEs) working on the project are very different (like in public open source projects)
  • you want to also use the project on an integration server like Hudson/Jenkins. You need to use Maven or some other standardized artifact lifecycle management tool outside Eclipse then.

The best solution: Use Maven to describe your dependencies and build process completely independent of Eclipse. Afterwards use Tycho to "act as a broker" between the Maven and the Eclipse world. That way you know exactly what to put under version control and everyone will produce exactly the same builds (independent of what IDE he uses or which plugins are installed).

Upvotes: 1

Shark
Shark

Reputation: 6610

I never commit those (esp .project) and always vote for them to be svn:ignore'd. Maybe I'm wrong but I only commit code to SVN and then make a new project by checking out from SVN.

Every time I checked out a project which had those files commited literally BROKE my project. But then again maybe thats just my coworkers... By breaking i mean converting these

src/com.package.name1
src/com.package.name2
src/com.pack.name1
src/com.pack.name2

to these

src/
src/com
src/com/package
src/com/package/name1
src/com/package/name2
src/pack
src/pack/name1
src/pack/name2

and other sorts of unnecessary irritations... like them not being recognized as packages anymore but as folders. One of those things that makes you have to run eclipse -clean or delete/reimport a project or waste time on eclipse stuff you don't wanna waste time on.

Upvotes: 1

Related Questions