Synchronizing Eclipse .classpath in code repository

孤街浪徒 提交于 2019-11-29 11:29:34

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.

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

The build is broken because the absolute path to the JAR is different in each developer machine? If so, you could add a user variable to avoid the issue, this way each developer only have to configure one variable (like LIB_DIR):

<classpathentry kind="var" path="LIB_DIR/path/to/file.jar"/>

There are other solutions. You could configure some user libraries in eclipse to group your JARs, and then export a .userlibraries file which could be shared in your repo. This way, there would be no absolute paths in .classpath, but they would be present in your .userlibraries.

You could also use some tool like Maven to manage dependencies on your project.

Anyway, I think you could share .classpath without problems...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!