通过插件导出包(Exporting of packages by a plugin)

编程入门 行业动态 更新时间:2024-10-20 20:54:18
通过插件导出包(Exporting of packages by a plugin)

我有一个第三方eclipse插件,它导出了一些在编译我的其他插件时不应该出现的软件包。

无条件地向下游插件显示这些包(根据此处的约定,它被分类为Accessible)。

一种选择是手动编辑插件并禁止导出的包。 编辑插件对我来说不是一个选项(许可证问题)。

另一种选择是使用-Dosgi.resolverMode = strict VM参数启动。 我也不能使用此选项,因为这会影响我环境中的其他插件。

我的理解可能是错误的。 任何帮助将不胜感激,或欢迎任何其他选择。

例如 :

我有一个名为net.jeeeyul.eclipse.themes_2.2.0.I20140916-113709的插件,它导出以下包

Export-Package: com.google.common.annotations,com.google.common.base,c om.google.common.base.internal,com.google.common.cache,com.google.com mon.collect,com.google.common.escape,com.google.common.eventbus,com.g oogle.common.hash,com.google.common.html,com.google.common.io,com.goo gle.common.math,com.google.common.net,com.google.common.primitives,co m.google.common.reflect,com.google.common.util.concurrent,com.google. common.xml,net.jeeeyul.eclipse.themes,net.jeeeyul.eclipse.themes.css, net.jeeeyul.eclipse.themes.rendering,net.jeeeyul.eclipse.themes.util, org.eclipse.xtend.lib,org.eclipse.xtend.lib.annotations,org.eclipse.x tend2.lib,org.eclipse.xtext.xbase.lib,org.eclipse.xtext.xbase.lib.int ernal,org.eclipse.xtext.xbase.lib.util

这不应该发生。 在编译期间,其他插件都不应该看到这些插件。

I have a third party eclipse plug-in which exports few packages which should not be present during compilation of my other plug-ins.

The packages are visible to downstream plug-ins unconditionally (It is classified under Accessible as per the convention here).

One option would be to edit the plug-in manually and make the exported packages forbidden. Editing the plug-in is not an option for me (license issues).

Another option would be to launch with the -Dosgi.resolverMode=strict VM argument. I cannot use this option also as this would impact other plug-ins in my environment.

My understanding might be wrong above. Any help would be greatly appreciated or any other options are welcome.

For example :

I have a plug-in called net.jeeeyul.eclipse.themes_2.2.0.I20140916-113709 which exports the following packages

Export-Package: com.google.common.annotations,com.google.common.base,c om.google.common.base.internal,com.google.common.cache,com.google.com mon.collect,com.google.common.escape,com.google.common.eventbus,com.g oogle.common.hash,com.google.common.html,com.google.common.io,com.goo gle.common.math,com.google.common.net,com.google.common.primitives,co m.google.common.reflect,com.google.common.util.concurrent,com.google. common.xml,net.jeeeyul.eclipse.themes,net.jeeeyul.eclipse.themes.css, net.jeeeyul.eclipse.themes.rendering,net.jeeeyul.eclipse.themes.util, org.eclipse.xtend.lib,org.eclipse.xtend.lib.annotations,org.eclipse.x tend2.lib,org.eclipse.xtext.xbase.lib,org.eclipse.xtext.xbase.lib.int ernal,org.eclipse.xtext.xbase.lib.util

This should not happen. None of these plug-ins should be visible to other plug-ins during compilation.

最满意答案

在每个下游插件项目中,您可以通过Java Build Path 添加访问规则:转到属性节点Java Build Path> Libraries> Plug-in Dependencies> Access rules 。 尝试此方法时,请参阅组合访问规则 。

In each downstream plugin project you can add access rules via the Java Build Path: Go to the properties node Java Build Path > Libraries > Plug-in Dependencies > Access rules. When trying this approach please consult Combine Access Rules.

更多推荐

本文发布于:2023-04-29 11:34:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1336361.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:插件   Exporting   plugin   packages

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!