开发者

How to handle Eclipse build path in a team, where local workspace paths are different?

开发者 https://www.devze.com 2023-03-27 23:15 出处:网络
A colleague has checked in an Eclipse project. All thei开发者_运维百科r classpath .jar references point to a workspace specific to their machine:

A colleague has checked in an Eclipse project.

All thei开发者_运维百科r classpath .jar references point to a workspace specific to their machine:

c:\joesworkspace\myproj1\lib\somejar.jar

I am using a different workspace, so the references are all broken.

I could create my own references pointing to the correct path on my machine, but then it would break references for my colleague when I check in.

An alternative would be to duplicate my colleague's directory structure, but I'd prefer not to do that either.

What's the best way to handle this?


You could use an environment variable, that points to the workspace or the project as top level path. All paths under that path have to be equal though.

Or you could use a dependency management software like Maven (which i would consider as the best solution).


If the JAR files are contained within the project, they should be adding the JAR references as relative instead of absolute. That is, on the properties of the project, choose Add JARs instead of Add External JARs.

If the JAR files are not contained within the project, then, well, put 'em in the project. That'll make it more portable (to other workspaces).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号