Java项目:应该的.classpath项目文件被提交到资料库? [英] Java project: should .classpath .project file be committed into repository?

查看:756
本文介绍了Java项目:应该的.classpath项目文件被提交到资料库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该在我的.project以及classpath文件检查?

Should I check in my .project and .classpath files?

我的朋友告诉我,我应该在.java文件,并保证便携性的build.xml只检查。他说:的.classpath会导致你在不同的环境少得多的便携性。的.project完全是当地的日食设置

My friend told me that I should only check in .java files and the build.xml to guarantee portability. He said ".classpath will cause you much less portability on different environment. .project is entirely your local eclipse setting"

我同意他的观点,但部分。

I agree with him, but partially.

- 在项目文件不检查会让我的开发效率不高(我不能简单地进口的项目$ C $从目录c)

-- Not checking in .project file will make my development less efficient (I can't simply "import" a project code from a directory)

- (?)。如果我的build.xml被浓墨重彩.classpath文件不检查似乎确定以我

-- Not checking in .classpath file seems OK to me (?) if my build.xml is written carefully.

有人想在这里分享他们的经验?

Anyone wants to share their experience here?

推荐答案

有什么错在的.project 检查和的.classpath 。我想这样做,如果你的的build.xml 不能创建两个文件为您服务。正如你所说,这是不舒服,当你尝试创建一个新的Eclipse工作区错过这些文件。

There is nothing wrong with checking in .project and .classpath. I would do so, if your build.xml isn't able to create both of the files for you. As you said, it's uncomfortable to miss these files when you try to create a new eclipse workspace.

在你的的.classpath 检查,你应该确保在它里面没有绝对路径。它转换成一个相对用文本编辑器。

Before you check in .classpath you should be sure that there is no absolute path in it. Convert it into a relative one with a text editor.

编辑:或甚至更好,你绝对否则使用pathes月食类路径变量,如@泰勒 - 利斯评论

Or even better, use eclipse classpath variables in your otherwise absolute pathes, like @taylor-leese commented.

这篇关于Java项目:应该的.classpath项目文件被提交到资料库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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