What do you think has to be kept on SVN when working in Java with Eclipse and Maven? Why?
I'm talking about the Eclipse specific files, Maven files, and other files.
This question is general and applies to all version control system.
Thanks
What do you think has to be kept on SVN when working in Java with Eclipse and Maven? Why?
I'm talking about the Eclipse specific files, Maven files, and other files.
This question is general and applies to all version control system.
Thanks
The goal is that if you don't have anything from the project on your workstation and you grab the head revision from trunk, you should be able to immediately build and run the project.
The most simplistic approach is that you store enough so that a new person to the product can checkout/sync and create a build.
Anything beyond that depends on your personal preference for clutter.
What is purpose of this question?I think files which eclipse put under version control is files which should be under version control.That is all you nned if you want to do clean checkout and start to develop.
Maven poms, definitely, because they store dependency information and build instructions, just like Makefiles.
Eclipse metadata files I'm less sure about. IMHO if it works to just import the project into Eclipse using the Maven project import wizard, then don't, because it's redundant information, and Eclipse doesn't necessarily take care not to include pathnames to your local machine there. OTOH it might be more convenient to put them in, especially if they sometimes require some tweaking to get working (e.g. here we have all manner of problems getting the Maven and WebTools plugins to cooperate). So in practice here at work we do have .project, .classpath and .metadata checked in. From time to time, when dependencies change, someone will check in changes that their Eclipse has made to them. Provided everyone uses the same version of Eclipse, with all the same plugins, and has the same set of projects open, this generally works, I just don't really like it.
One thing backing this view is that my idea of a "canonical" build is one done by continuous integration, and for us that just uses the Maven command. That's how builds for dev-integ, QA and prod are made, and that's what has to work: building things in Eclipse is secondary.
You only need to check your pom.xml
and your source files, the Eclipse project files can safely be ignored. When checking out you project, open it with aid of the m2eclipse plugin. If that is not available, you can use the mvn eclipse:eclipse command to recreate your .project
and .classpath
files. Likewise, ignore the /target
folders, because everything that ends up there is generated (and can thus be regenerated) when you build your project.