2

Please help me understand or possibly stop Eclipse churn. I'm developing a webapp structured as a collection of Maven modules: 3 jars, 1 war. I'm using Eclipse mars j2ee, it has m2e version 1.6.3.20160209. Almost every time I switch branches and eclipse reopens my projects, the jar projects take an update to the file .settings/org.eclipse.wst.common.component and git says "hey file changed". These projects seeing the change are NOT war package type, they are jars. The file contents are trivial like this:

<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="jarProjName">
        <wb-resource deploy-path="/" source-path="/src/main/java"/>
    </wb-module>
</project-modules>

Thanks in advance.

UPDATE to respond to comments about ignoring all Eclipse dot files:

Ok probably the o.e.w.c.component file is safe to ignore in jar projects.

However, we have chosen to share via git clean .project and .classpath files (e.g., using Java execution environments, not path on local machine). This usually saves time. We waste a lot of time fighting Eclipse/m2e odd behaviors :(

chrisinmtown
  • 3,571
  • 3
  • 34
  • 43
  • Probably, this isn't a solution, but you can add it to .gitignore. – Armine Jun 15 '16 at 13:56
  • 1
    those files should be added to `.gitignore` actually, they should not be under version control – A_Di-Matteo Jun 15 '16 at 13:57
  • `.project`, `.classpath` and the `.settings` folder should be ignore and of course `target`. – khmarbaise Jun 15 '16 at 14:00
  • 1
    I don't think .settings can be ignored in most circumstances, although I think it would be nice to be able to. There are a lot of settings that can not be controlled from m2e. http://stackoverflow.com/questions/8417243/is-it-a-good-practice-to-include-eclipse-project-files-in-with-sources-in-scm?rq=1 – KarlP Sep 20 '16 at 00:59
  • You cannot add this file to `.gitignore` because it often has project specific settings inside it. – Dave Dec 12 '16 at 14:27
  • I've just discovered this problem in my own workspace. What did you end up doing to resolve? Have you used IntelliJ with this Maven project before? If so, how is it? – Daniel Aug 25 '17 at 22:50
  • No solution to the churn. Sorry no experience with IntelliJ. – chrisinmtown Aug 27 '17 at 11:12

1 Answers1

0

One year later a half answer: I did not find a way to stop the churn, instead we ignore the churn by excluding all IDE metadata from the git repo. The Maven (m2e) plugin does a good job at importing projects, it recreates the .classpath, .project and .settings/ files at import time. So a new developer can clone, import and be all set.

@HDave makes the point that some settings cannot be ignored due to m2e limitations. Please post details about those settings. That issue has not burned us yet, I guess we are not using any of those settings.

chrisinmtown
  • 3,571
  • 3
  • 34
  • 43