javaeclipseexportruntime-packages

Exporting of packages by a plugin


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).

  1. 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).

  2. 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.

  3. 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.


Solution

  • 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.