项目的一部分是.settings / org.eclipse.jdt.core.prefs? [英] Is .settings/org.eclipse.jdt.core.prefs part of the project?

查看:774
本文介绍了项目的一部分是.settings / org.eclipse.jdt.core.prefs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

项目的一部分是文件 .settings / org.eclipse.jdt.core.prefs 还是我的个人eclipse配置的一部分?

Is the file .settings/org.eclipse.jdt.core.prefs part of the project or is it part of my personal eclipse configuration?

是否应该将其添加到版本控制?

Should I add it to version control?

推荐答案

如果此文件不在版本控制之下,则不能创建同一项目的可重复构建,因为它不再是独立的,而是依赖于您的特定Eclipse安装及其设置。

Yes, you should. If this file is not under version control, then you cannot create reproducable builds of the same project, because it is no longer self contained, but depends on your specific Eclipse installation and its settings.

如果将此项目导入另一个工作区(在您或任何其他机器上),它可能会有完全不同的地方,因为编译器遵从性设置,编译器警告配置和许多其他内容突然丢失或不同。机会很高,这样的项目突然在新的工作区中显示警告/错误,而之前完全没有。

If you import this project into another workspace (on your or any other machine), it may behave completely different, as the compiler compliance settings, the compiler warnings configuration and a lot of other stuff is suddenly missing or different. Chances are high that such a project suddenly shows warnings/errors in the new workspace, while it was completely fine before.

注意:这一切都要求您实际上在项目属性中配置所有与Java相关的设置。如果您想拥有自包含的项目,请不要使用Window - > Preferences下的Java编译器设置。

Note: This all also requires that you actually configure all Java related settings in the Project properties. Never use the Java compiler settings under Window -> Preferences if you want to have self contained projects.

仅仅是为了给出一个具体的例子:如果你已经配置了项目编译器的合规性级别到Java 6,因为您正在使用Java 6的特定功能(如覆盖接口上的注释),那么项目将创建大量编译错误在其他人的机器上。这是因为每个Eclipse工作区中的默认编译器合规性级别都是Java 1.5,而在Java 1.5中,根本不允许覆盖注释。

Just to give a concrete example: If you have configured your projects compiler compliance level to Java 6, because you are using Java 6 specific features (like Override annotations on interfaces), then the project will create a lot of compile errors on other peoples machines. This is because the default compiler compliance level in every Eclipse workspace is Java 1.5, and in Java 1.5 that Override annotation is simply not allowed.

这没有任何东西无论您是开发封闭源代码还是开放源代码,请参阅其他答案。

This doesn't have anything to do with whether you are developing closed source or open source, as indicated in the other answer.

这篇关于项目的一部分是.settings / org.eclipse.jdt.core.prefs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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