Just curious since there was a discussion today on my team...
If you're using eclipse on a project do you check-in your project
files to source control for everyone to use? (The .classpath
and .project files, that is). Or do engineers just set up their own
local eclipse projects which are never checked-in? What's the more
common approach?
I don't use Eclipse, but the same issue is relevant to other IDEs. I used
to advocate excluding all IDE configuration from source control (with
ignore patterns set to avoid accidental addition) and leaving it to
individual developers' preferences. The reasoning behind this is that
they are often using different IDEs, usually have different personal
preferences, and the IDE configuration is largely incidental since
everybody must use the Ant build.xml for building (allowing different team
members to use different tools/configurations for builds is
counter-productive).
However, I'm now favouring maybe adding at least some of the configuration
files to source control.
While we do have Eclipse users in the company, all of the Java developers
on my current project team use IntelliJ IDEA. IDEA uses three files for
configuration - .ipr is the project file, .iml is the module file
(typically more than one of these) and .iws is the workspace file. I have
added the .ipr and .iml files to Subversion and excluded the .iws file.
This gives us shared configuration for paths, dependencies, etc. but
leaves out developer-specific stuff like debug configurations and view
settings.
IDEA is flexible as to where the configuration files reside, so in our
case these shared ones are tucked away in a configuration directory in the
project repository for team members to use if they wish. This means they
won't clash with files in the project root if the developer chooses to use
their own configuration files. A default configuration for NetBeans could
easily be added to this configuration directory if needed and, assuming
Eclipse is not too fussy about the location of its config files, you could
do the same for Eclipse.
The advantage of using the shared files is that you get the benefit of any
reconfigurations that other people do (for example, when a library
dependency changes). Another benefit is that if a new developer joins the
team, they can get started straight away without having to set everything
up for themselves.
Dan.