views:

454

answers:

9

What is the best way to allow a team of programmers to use Netbeans, Eclipse and IntelliJ on the same project, thus eliminating the "which IDE is better" question.

Which files should or should not be checked into source code control?

+6  A: 

Well, that's a pretty self-answering question.

The files to not check into source control are files that have to do with the IDEs themselves.

Leave it to the developers to generate these files.

If you use Maven, it can generate the files such as Eclipse's .project and .classpath for you. Eclipse in general is very easy to use with a basic file structure (with the new Java Project option).

I think Maven has Netbeans support as well, not sure about IntelliJ though.

Maven's site is maven.apache.org.

MetroidFan2002
To build upon this answer, see http://maven.apache.org/plugins/index.html. Near the bottom are plugins for Eclipse and IDEA. You load the project into your IDE (without the IDE specific files, and then let the plugin create those files for you.
Steve Moyer
The NetBeans plugins are here: http://mojo.codehaus.org/plugins.html ... why can't I get rep for this?
Steve Moyer
The generated projects do not include project-specific configuration settings for any plugins you might have. Not a big deal when you bootstrap, but keep it in mind when you refresh.
ddimitrov
It's good to "Leave it to he developers to generate these files", but make sure they're generated from the same source. If not using maven you should definitely use a similar mechanism to organise dependencies etc.
WMR
This is basically what we are currently doing, ten developers 3 IDE's one set of pom files. For the record Intellij's maven support is pretty good.
Gareth Davis
+2  A: 

There are many considerations when using multiple toolsets within the same project team. For example, my team has Java developers using IntelliJ and most of the front end (JSP/CSS/HTML) developers using eclipse. We are in the process of migrating the Eclipse users to IntelliJ because of some IntelliJ plugins that we have developed that provide extended support for our environment. We're not going to develop the plugins for multiple platforms, so we are standardizing on IntelliJ across the board.

In terms of specific files, I can speak to IntelliJ. We have checked in our .ipr files and our .iml files. Do not check in .iws files. If you also have Eclipse users, configure your IntelliJ project to read/store dependency information in the .classpath file and commit that to your VCS.

talanb
+4  A: 

For each IDE that has more than one developer, check-in all the supporting files. Why re-invent the wheel at every desk.

I have done this with many different IDEs, and I have yet to see a filename conflict.

In fact, even when only a single developer uses a particular IDE, it is to his/her advantage to version the supporting files, for the same reason that you version the other files in your development environment: history, diffing, comments, etc.

Chris Noe
it's important to make life easier for developers so that they can join the project and get up and running instantaneously
anjanb
Indeed, another reason. On my current project I'd estimate that we save a dozen hours per new developer that can pull the IDE configs along with the source.
Chris Noe
+4  A: 

For Eclipse, that would be .classpath and .project files.

My team uses Maven, and developers are discouraged from checking in Eclipse-specific files. Because they can be generated from Maven, these files are redundant.

Also, checking project-specific files seems like it would save time, but it usually winds up being a pain because of variations in different developers' workstations, resulting in wasted time resolving conflicts in the IDE-specific files. The only way to get around that is to force everyone to set up their environment the same way, which goes against the IDE-agnostic approach.

Ken Liu
A: 

Typically, I would consider this a bad idea. I'm not sure what kind of environment this is (perhaps open source?), but it would really suck to support multiple IDEs. One thing I would recomend if this is unavoidable, would be to standardize your builds in ant scripts. If you have a large set of dependencies, this may be the easiest way to get a predictable build across all platforms.

If one of the IDEs happens to be RAD (based on eclipse), there is an entire folder called .settings that you would not want to include in the SCM.

Konrad
What's the problem with using multiple IDEs? If you're not doing anything specific to an IDE (like using Eclipse's GUI editor) then it would work fine.
Herms
+1  A: 

We intentionally support multiple IDEs from the same SVN repository. Our thinking was that we want to ensure that, if a new person joined the team or someone had to start working on a new machine, we wanted them to be able to checkout the codebase, import it to the IDE and immediately have a work-able configuration.

What that means on the developer end is that they should not commit their changes to the IDE files. Everything else (e.g., src, test, lib and so forth) becomes the set that we normally update and commit every day.

The side benefit is that we have completely eliminated the IDE wars here: Netbeans and Eclipse people live in perfect harmony (looking askance at the IntelliJ people, but hey... ;-).

Bob Cross
+11  A: 

I think the best way is to make the build process independent of IDE. This means that your project should not rely on any IDE-specific files to build, but rather use an external build system, like Apache Maven, Apache Ant, or even make or custom scripts. Maven is supported by most popular Java IDEs, either directly or via plug-ins.

If you don't want to use an external build systems, you should at least make the project as easy to set up as possible (i.e. by having standard folders for shared libraries and other dependencies). When I have working on teams with multiple IDEs in the past, I spent by far the most time on resolving dependencies as the prerequisites for building the project changed over time. In the worst case you may even end up with developers not bothering to get the latest version from the version control repository, since they think setting up the new project is such a hassle.

If your project has many library dependencies, I think its a good idea to make these available in binary form in the version control repository. That way people don't have to resolve all the dependencies of the dependencies and so on just to build a single project. This does however require that you have someone responsible for keeping the "official" binaries up-to-date whenever they change. (This is pretty much the same philosophy used by the Maven repository, but the principles can be applied manually even when not using Maven.)

Anders Sandvig
A: 

We rename our IDE files for checkin with an extra extension .deletethis or similar. When a new person checks out the project, they simply strip off the extra extension and are good to go. This way we avoid source control conflicts with the project files as people tweak their environments. And you don't have to worry about educating new developers to not check in those files.

hlavka
+1  A: 

For more comments and answers on this topic see this question (How do you handle different Java IDEs and svn?)

Olaf