在提交项目时,我应该包括.project&的.classpath? [英] When commiting projects should I include .project & .classpath?

查看:205
本文介绍了在提交项目时,我应该包括.project&的.classpath?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我提交Web应用程序到源代码控制时,我还应该包括.project& .classpath文件?我不认为使用该项目的其他用户应该有相同的项目设置,应该有什么区别?

When I commit a web appliction to source control should I also include the .project & .classpath files ? I don't think it should make any difference either way as other users who use the project should have the same project settings ?

推荐答案

这是一个问题,让人们在一场永远不会结束的辩论中屈服于形状。您基本上有两个阵营:

This is the sort of question that gets people bent out of shape in a debate that never ends. You basically have two camps:


  1. 只将源代码放入源代码管理系统。每个开发人员选择自己的IDE并管理自己的项目配置。从存储库获取源代码之后设置IDE将是棘手的。如果一个开发人员更改项目依赖关系,则必须明确地进行通信,以便所有其他开发人员更新其项目配置。有一些工具试图解决这个问题,像一个Maven插件,它将尝试从pom.xml生成Eclipse项目元数据,但都有其局限性。以这种方式的团队有利于在IDE中限制开发人员选择的纯度,方便在整个团队中运行Eclipse项目。

  1. Only put source code into the source control system. Each developer chooses their own IDE and manages their own project configuration. Setting up your IDE after getting source code from the repository will be tricky. If one dev changes project dependencies, they have to explicitly communicate that so that all other devs update their project configurations. There are some tools that try to address this problem, like a Maven plugin that will attempt to generate Eclipse project metadata from pom.xml, but all have their limitations. Groups that go this way favor the purity of not restricting developer choice in IDE over the convenience of having Eclipse projects across the team that just work.

标准化Eclipse 。将所有Eclipse项目元数据放入源代码控制。这包括.project,.classpath和.settings的全部内容。基本上,您在源代码管理存储库中不需要的唯一内容是在Eclipse中标记为派生的内容。您可以通过右键单击>属性来检查。采用这种方法确保开发人员可以在从源代码管理获取项目后立即开始编码。不需要额外的配置。此外,当一个开发人员更改项目配置时,其余的团队将在下一次同步时看到相同的更改。

Standardize on Eclipse. Put all Eclipse project metadata into source control. This includes .project, .classpath and the entire contents of .settings. Basically, the only thing that you don't want in your source control repository is content marked as derived in Eclipse. You can check that in right-click->properties. Taking this approach ensures that developers can get started coding immediately after getting the project from source control. No additional configuration required. Also, when one dev changes project configuration, the rest of the team will see the same change on next sync.

选择最适合您团队的方法。

Choose the approach that makes the most sense for your team.

这篇关于在提交项目时,我应该包括.project&的.classpath?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆