在代码库中同步Eclipse .classpath [英] Synchronizing Eclipse .classpath in code repository

查看:123
本文介绍了在代码库中同步Eclipse .classpath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队使用Eclipse处理了几个Java项目,并使用代码库共享代码。

My team handles several Java projects using Eclipse, and shares the code using a code repository.

当开发人员添加,删除或更新 jar 文件,构建对所有人都是坏的,直到它们在Eclipse中更新其构建路径。这个过程涉及麻烦的电子邮件同步。

When a developer adds, removes or updates a jar file, the build is broken for everybody else, until they update their build path in Eclipse. This process involves cumbersome email synchronization.

由于几个原因,我们决定不将 .classpath 文件提交给回购相反,我们想出了以下想法:每个项目都将有一个提交的文件,例如 jars.list ,其中包含一个 jar 文件(和模式)。脚本将该文件转换为eclipse的本地 .classpath 。每当一个开发者改变罐子,他或她有责任改变 jars.list 并提交它。

For several reasons, we have decided not to commit the .classpath file to the repo. Instead, we came up with the following idea: Each project will have a committed file, say jars.list, which contains a list of jar files (and patterns). A script will convert this file into a local .classpath for eclipse. Whenever a developer changes its jars, it is his or her responsibility to change jars.list and commit it.

这是否合理解决?有没有解决这个问题的解决方案?

Is this a reasonable solution? Are there any existing solutions for this problem?

推荐答案

Eclipse .project .classpath 文件旨在/设计为检入版本控制库(cvs,svn,git等)。请参阅Eclipse wiki中的此页面

Eclipse .project and .classpath files are intended/designed to be checked into a version control repository (cvs, svn, git, etc). See this page in the Eclipse wiki.

有很多种方法来保持 .classpath 文件clean(即,没有绝对路径),我在上面的评论部分提到。

There are various ways to keep the .classpath file "clean" (ie, free from absolute paths), which I mentioned in the Comments section above.

这篇关于在代码库中同步Eclipse .classpath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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