解释 eclipse .classpath 文件。'kind="con"' 和 'exported="true"' 是什么意思?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13960556/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:39:17  来源:igfitidea点击:

Interpreting eclipse .classpath file. What does 'kind="con"' and 'exported="true"' mean?

javaeclipseeclipse-pluginclasspath

提问by prosseek

This is the eclipse .classpathfile of the eclipse plugin program that I downloaded.

这是.classpath我下载的eclipse插件程序的eclipse文件。

I think that kind="src"and kind="output"is pretty straight forward, as they means the where the source java files and compiled class files are located.

我认为这kind="src"kind="output"是相当直接的,因为它们意味着在源java文件和编译的类文件的位置。

The kind="lib"seems to indicate the jar files the plugin is referencing, but I have something that I'm not sure about.

kind="lib"似乎预示着jar文件的插件引用,但我有一些我不知道的。

  • What does the kind="con"mean?
  • What is it for the exported="true"? I think in order to use this plugin, all the jar files that the plugin refers to should be exported, but only some of them are exported.
  • 这是什么kind="con"意思?
  • 它有exported="true"什么用?我觉得为了使用这个插件,插件引用的jar文件都应该导出,但是只导出了一部分。

enter image description here

在此处输入图片说明

采纳答案by yair

1) In kind="con", the constands for container, which is interpreted by eclipse as a classpath container. As described in that link:

1)在kind="con"con代表container,eclipse将其解释为classpath container。如该链接中所述:

A classpath container provides a way to indirectly reference a set of classpath entries through a classpath entry of kind CPE_CONTAINER

类路径容器提供了一种通过 CPE_CONTAINER 类型的类路径条目间接引用一组类路径条目的方法

In other words, it enables grouping of other classpath entries in any way and re-use it wherever (including the ability of having different entries for different projects).

换句话说,它允许以任何方式对其他类路径条目进行分组,并在任何地方重新使用它(包括为不同项目设置不同条目的能力)。

2) exported: Say you have Project Bthat depends on Project C. The dependency is defined as exported=true. Then, another Project Athat depends on Project B, will have also Project Cpresent on A'a classpath.

2) exported:假设您有B一个依赖 Project 的 Project C。依赖项定义为exported=true. 然后,另一个A依赖于 Project 的 ProjectB也将 ProjectC存在于A“类路径”中。

回答by Will

  • kind="con" are indicating classpath containers
  • exported=true exports the dependency, meaning that any project that has a depedency on your project can see/access the exported dependencies as well.
  • kind="con" 表示类路径容器
  • export=true 导出依赖项,这意味着任何依赖于您的项目的项目也可以查看/访问导出的依赖项。