签入还是不签入整个 Eclipse 项目? [英] To check in, or not check in, the entire Eclipse project?

查看:21
本文介绍了签入还是不签入整个 Eclipse 项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很快将检查新 Java 项目的第一次提交.我使用 Eclipse Ganymede 和一堆插件让事情变得更容易一些.

I'm soon going to check in the very first commit of a new Java project. I work with Eclipse Ganymede and a bunch of plug ins are making things a little bit easier.

之前我参与过的项目都是将整个Eclipse项目都签入.签出后获取项目设置非常方便.然而,这种方法仍然不是没有问题:

Previously I've been part of projects where the entire Eclipse project was checked in. It's quite convenient to get the project settings after a check out. However this approach still was not problem free:

  • 我强烈怀疑某些 Eclipse 配置文件会在没有用户交互的情况下更改(从我使用 Eclipse Europa 开始),使它们在需要提交时显示为已更改(因为它们已更改,但不是交互式的).
  • 每台开发机器都有独特的设置,以及项目中所有开发人员的全局设置.将它们分开很难.
  • 有时如果 Eclipse 版本与其他版本不同,Eclipse 会生气并弄乱项目配置.另一种情况是它更改了格式以进行更新,如果提交会破坏其他人的配置.

对于这个特定的项目,我还有另一个不提交项目文件的原因:

For this specific project I have another reason not to commit the project files:

  • 可能有些开发人员更喜欢 NetBeans,稍后将加入该项目.但是,他们不会在未来几个月内加入.

你如何组织这个?你在版本控制中检查什么,你在外面保留什么?在这种情况下,您认为最佳做法是什么?

How do you organize this? What do you check into versioning control and what do you keep outside? What do you consider best practice in this kind of situation?

推荐答案

您至少应该签入 .project.classpath 文件.如果您团队中的任何人在 .classpath 中硬编码外部 JAR 位置,您应该将它们靠墙并射击.我使用 Maven 来管理我的依赖项,但如果您不使用 Maven,您应该使用一致的命名约定为您的外部 JAR 创建用户库.

At a minimum you should be check-in the .project and .classpath files. If anybody on your team is hard-coding an external JAR location in the .classpath you should put them up against the wall and shoot them. I use Maven to manage my dependencies but if you are not using maven you should create user libraries for your external JARs with with a consistent naming convention.

之后,您需要逐个插件地考虑事情.例如,我使用 Spring,所以我总是签入 .springBeans,同样对于 CheckStyle,我总是签入 .checkstyle 项目.

After that you need to consider things on a plug-in by plug-in basis. For example I work with Spring so I always check-in the .springBeans and likewise for CheckStyle I always check-in the .checkstyle project.

当涉及到 .settings 文件夹中的配置时,它会变得有点棘手,但如果我更改了项目的默认设置并希望它们与其余部分共享,我通常会签入以下内容团队成员:

It gets a bit trickier when it comes to the configuration in the .settings folder but I generally check-in the following if I change the default settings for my project and want them shared with the rest of the team:

  • .settings/org.eclipse.jdt.ui.prefs - 它包含导入顺序的设置
  • .settings/org.eclipse.jdt.core.prefs - 它包含编译器版本的设置
  • .settings/org.eclipse.jdt.ui.prefs - it contains the settings for the import ordering
  • .settings/org.eclipse.jdt.core.prefs - it contains the settings for the compiler version

总的来说,我没有注意到 Ganymede 在没有修改项目首选项的情况下修改文件.

In general I haven't noticed Ganymede modifying files without me modifying the project preferences.

这篇关于签入还是不签入整个 Eclipse 项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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