Ignore Eclipse .project and .classp 8000 ath when using build tools Maven or Gradle#3710
Ignore Eclipse .project and .classpath when using build tools Maven or Gradle#3710baincd wants to merge 1 commit intogithub:masterfrom
Conversation
|
Please use this file instead. https://github.com/github/gitignore/blob/master/Global/Eclipse.gitignore |
|
@bdougie I kindly ask that this PR be reconsidered. How to handle the The reasoning for removing these files from
The problem is when using a build tool like Maven or Gradle, the Therefore, to correctly handle all scenarios, I suggest adding these files to There is also precedent for this solution, as there are other examples of Eclipse files being included in non-Eclipse gitignore files. Thank you, |
|
I am not convinced that you actually understand the intention of this PR, because your answer makes no sense in this context. I think you closed this PR prematurely. We are using https://github.com/github/gitignore/blob/master/Global/Eclipse.gitignore, and this template correctly doesn't exclude I think @baincd is absolutely right to ignore these files in |
Along with |
|
@jglick The confusion is with |
Are you sure? I get e.g. <factorypathentry kind="VARJAR" id="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar" enabled="true" runInBatchMode="false"/>as a result of that JAR being defined in my dependency tree.
But how many people in 2021 still seriously rely on versioned IDE-specific build configuration? You can always gh repo clone mycorp/some-random-maven-project
cd some-random-maven-project
code .
git statusand not see four untracked files IMHO. (NetBeans has long made a point of opening directories with a At any rate, I agree this PR should be considered as better than the status quo. |
Good catch, I spoke too soon. But my original point is still valid - those files are already in
While I agree with you in theory, in reality these still exist in the wild (I worked on a few projects like this just a few years ago). And as you can see earlier in this comment, those files have been added to Eclipse gitignore twice, only to be removed each time. There is clearly not a consensus this issue. This PR was my attempt at a compromise that avoids all this debate, and would just work for all scenarios. But alas, it was rejected. :-/ |
Feel free to reopen on a new PR linking to this one. This context was helpful to read and understand. |
Reasons for making this change:
Eclipse
.projectand.classpathfiles should be ignored when using a build tool like Maven or Gradle. However, when not using a build tool, these files should be under source control.Links to documentation supporting these rule changes:
There has been alot of back and forth on the
.projectand.classpathfiles within Eclipse, but I think this comment sums it up nicely.The consensus is that these files should not be ignored in all Eclipse projects. However, when a build system such as Maven or Gradle is used, these files should be ignored because they will be generated by the Eclipse plugin for the build tool. Therefore, adding these files to the Maven and Gradle gitignore files should cover all scenarios.