依赖关系路径如何在Java .ClassPath文件中起作用?

发布于 2025-01-24 23:24:23 字数 459 浏览 2 评论 0原文

在Java .ClassPath文件中,我看到了很多依赖关系路径,类似的是:

<classpathentry kind="lib" path="/a/b/c/d/library.jar"/>

这些路径是本地文件系统绝对的,还是相对于某些项目文件夹?

如果没有使用Maven之类的工具,多个开发人员如何在同一项目上共享相同的项目。如果同一项目的不同开发人员在不同的OS(例如Windows和Linux)上工作,这些路径仍然有效吗?对于Windows说,我可以为文件系统拥有绝对的路径(例如C:\ my_repo ...)吗?如果我们共享相同的.ClassPath文件,那会破坏Linux开发人员吗?

而且,如果我将项目传递给其他人继续进行工作,那么该人如何将这些依赖性JAR文件放回其本地存储库,而无需从Internet/Maven Central手动下载这些罐子? (不使用Maven,那就是...)

In the Java .classpath file, I see a lot of dependency paths, something like this:

<classpathentry kind="lib" path="/a/b/c/d/library.jar"/>

Are these paths absolute to local file system, or are they relative to some project folders?

Without using tools like Maven, how can multiple developers work on the same project sharing the same .classpath if they have different dependency repo location? If different developers of the same project work on different OS, like Windows and Linux, would these paths still work? Say for windows, can I have a path absolute to my file system (e.g. C:\my_repo...)? Would that break something for the Linux developers if we share the same .classpath file?

And if I pass the project to someone else to continue to work on, how can that person get those dependency jar files back on their local repo without downloading those jars one by one manually from the Internet/Maven central? (Without using Maven, that is...)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文