Eclipse CVS 忽略 .class 文件——如何将其关闭?

发布于 2024-08-13 13:30:47 字数 98 浏览 2 评论 0原文

我想通过 Eclipse 将新的 .class 文件提交到 CVS,但这些文件被忽略,而且我不知道在哪里将其关闭。 “首选项”窗口中有一个部分用于执行此操作,但未列出 .class。

I would like to commit new .class files into CVS via Eclipse, but these files get ignored, and I'm not sure where to turn that off. The Preferences windows a section for doing this, but .class isn't listed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

仙女 2024-08-20 13:30:47

首选项>团队>忽略的资源

另外,更改为资源透视图以查看所有文件。

Preferences > Team > Ignored Resources

Also, change to the Resources Perspective to see all files.

场罚期间 2024-08-20 13:30:47

首先,我想回应其他答案的观点,因为将编译的源文件检查到源代码管理中是一个非常糟糕的主意,因为这意味着任何时候有人对源代码进行更改时,他们都必须记得签入相应的类文件。

关于您的具体问题, 此页面指出所有生成的 .class 文件都会自动标记为派生文件,这意味着它们不会自动签入:

任何标记为派生的资源都将被 Team CVS 的版本管理自动忽略。某些构建器(例如 Java 构建器)将其所有构建输出(例如 .class 文件)标记为派生的。

据我所知,没有办法改变这一点,这应该强调这是一个坏主意。

First of all I'd like to echo the sentiment of the other answers, in that checking the compiled source files into source control is a very bad idea, as it means any time someone makes a change to the source, they'll have to remember to checkin the corresponding class file.

Regarding your specific question, this page states that all generated .class files are automatically marked as derived, meaning they won't be checked in automatically:

Any resource marked as derived will be automatically ignored for version management by Team CVS. Some builders, such as the Java builder, mark all of its build output (e.g. .class files) as derived.

To my knowledge there no way of changing this, which should underline that this is a bad idea.

蓝天白云 2024-08-20 13:30:47

我最终弄清楚了......这有点奇怪:您必须进入“首选项”窗口(“团队”->“忽略的资源”)并将“.class”添加为忽略的资源,然后取消选中该复选框。

I ended up figuring it out... it's a little odd: You have to go into the Preferences window (Team -> Ignored Resources) and add ".class" as an ignored resource, then uncheck the check box.

独孤求败 2024-08-20 13:30:47

您确实确定要将已编译的文件检查到 CVS 中吗?我从来没有参与过这样做的项目——这是一个不好的做法。

您应该只在 CVS 中真正存储源代码,而不是从源代码生成的文件。没有真正需要签入这些,因为它们可以随时从源代码重新生成。

通过检查源代码的输出,您只会因为有人忘记检查 .class 文件等而引入令人头痛的可能性。

Are you really sure you want to be checking compiled files into CVS? I've never worked on a project that does this - it is a bad practice.

You should only really store source code in CVS, not the files generated from the source code. There is no true need to check these in because they can be re-generated from source code at any point in time.

By checking in the output of your source code, you're only going to introduce the possibility of headaches due to someone forgetting to check a .class file in, etc.

戴着白色围巾的女孩 2024-08-20 13:30:47

如果有人仍然感兴趣,尽管我绝对同意将 .class 文件检入 CVS 是一种不好的做法,但有时我认为这是合理的。

例如,在我的例子中,我有一个包含 EJB 3.1 的应用程序,该应用程序必须由外部代理 (ControlM) 调用。由于 EJB 由远程进程调用,因此需要生成的存根 (.class)。在这种情况下,我将这个生成的存根类签入 CVS,因为我希望所有团队成员都可以使用它。

我所做的如下:

  1. 打开导航器视图。 (在此视图中,所有 .class 都可以通过
    默认)
  2. 选择 .class / 右键单击​​ / Team / 添加到版本控制
  3. 接受警告,表示您将添加忽略
    resources

现在可以照常提交 .class。

If anyone is still interested, although I absolutely agree it is a bad practice to check .class files into CVS, sometimes I think it is reasonable.

For example, in my case I have an application that contains an EJB 3.1 which has to be called by an external agent (ControlM). As the EJB is called by a remote process the generated stub (.class) is needed. In this situation, I checked this generated stub class into the CVS because I want it avaliable for all the team members.

What I do is the following:

  1. Open the Navigator View. (In this view all .class can be viewed by
    default)
  2. Select the .class / right click / Team / Add to Version Control
  3. Accept the warning saying that you are going to add ignored
    resources

Now the .class can be committed as usual.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文