要登录或不登录,整个Eclipse项目? [英] To check in, or not check in, the entire Eclipse project?

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

问题描述

我很快会检查一个新的Java项目的第一次提交。我与Eclipse Ganymede一起工作,一堆插件正在使事情变得更加容易。



以前,我一直是整个Eclipse项目被检入的项目的一部分退房后取得项目设置是非常方便的。但是,这种方法仍然没有问题:




  • 我强烈怀疑一些Eclipse配置文件会在没有用户交互的情况下改变(从我使用Eclipse欧罗巴),当它们做出承诺时,它们会发生变化(因为它们被改变而不是交互式)。

  • 每个开发机器都有独特的设置以及设置全局为项目的所有开发人员。如果Eclipse版本与其他版本不同,那么Eclipse会生气,搞砸项目配置。另一种情况是,它会更改格式,以便更新,如果已经为其他人提供了配置,则会导致混淆。



我有另一个原因不提交项目文件:




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



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

解决方案

至少您应该登录 .project .classpath 文件。如果您的团队中的任何人在 .classpath 中硬编码外部JAR位置,则应将其放在墙上并拍摄。我使用Maven来管理我的依赖关系,但是如果你不使用maven,你应该为外部JAR创建用户库,并具有一致的命名约定。



之后,你需要通过插件来考虑插件上的东西。例如,我使用Spring,所以我总是检入 .springBeans ,同样为CheckStyle我总是检入 .checkstyle project。



当涉及 .settings 文件夹中的配置时,会有点棘手,但如果我更改了我的项目的默认设置,并希望与团队的其他成员共享,我通常会检查以下内容:




  • .settings / org.eclipse.jdt.ui.prefs - 它包含导入排序的设置

  • .settings / org.eclipse.jdt。 core.prefs - 它包含编译器版本的设置



一般来说,我没有注意到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.

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:

  • I strongly suspect that some Eclipse configuration files would change without user interaction (from when I used Eclipse Europa), making them appear as changed (as they were changed, but not interactively) when it's time to do a commit.
  • There are settings unique to each development machine as well as settings global for all developers on a project. Keeping these apart was hard.
  • Sometime if the Eclipse version was different from others Eclipse would get angry and mess up the project configuration. Another case is that it change the format so it gets updated, and if commited messes up the configuration for others.

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

  • There might be developers who prefer NetBeans which will join the project later. However they won't join within the coming months.

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?

解决方案

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.

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.

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 - it contains the settings for the import ordering
  • .settings/org.eclipse.jdt.core.prefs - it contains the settings for the compiler version

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

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

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