Home » Eclipse Projects » Plugin Development Environment (PDE) » Exposing packages from a jar inside a plug-in
| |
Re: Exposing packages from a jar inside a plug-in [message #668202 is a reply to message #667475] |
Wed, 04 May 2011 13:36 |
Raymond Mising name Messages: 59 Registered: July 2009 |
Member |
|
|
Sorry for later reply.
Manifest of A looks like:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: XXXXXX
Bundle-SymbolicName: A
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: XXXXXX
Require-Bundle: B,
......
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: Research In Motion Limited
Export-Package: net.rim.ajde.external
Bundle-ClassPath: apache-mime4j-0.6.jar,
httpclient-4.0.3.jar,
httpcore-4.0.1.jar,
httpmime-4.0.3.jar,
.
Manifest of B looks like:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: B
Bundle-SymbolicName: XXXXXXXX;singleton:=true
Bundle-Version: 11.0.0.qualifier
Bundle-Activator: XXXXXXXXXX
Bundle-Vendor: XXXXXXXXX
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
......
Bundle-ActivationPolicy: lazy
Export-Package: a.b.c,
......
Bundle-ClassPath: .,
libs/lib.jar,
Thanks.
|
|
| |
Re: Exposing packages from a jar inside a plug-in [message #668234 is a reply to message #668202] |
Wed, 04 May 2011 15:31 |
|
On 05/04/2011 09:36 AM, Raymond wrote:
> Sorry for later reply.
> Manifest of A looks like:
> Require-Bundle: B,
> Manifest of B looks like:
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: B
> Bundle-SymbolicName: XXXXXXXX;singleton:=true
> Bundle-ActivationPolicy: lazy
> Export-Package: a.b.c,
> .....
> Bundle-ClassPath: .,
> libs/lib.jar,
I'll assume you matched your Require-Bundle: B to the real
Bundle-SymbolicName provided in B (your example, XXXXXXX :-)
That's all that is needed.
I created a plugin z.ex.jars.b with the following:
Bundle-ClassPath: libs/version_1.0.0.jar,
.
Export-Package: ex
Then a plugin z.ex.jars.a with:
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
z.ex.jars.b;bundle-version="1.0.0"
I was able to import ex.Version (from z.ex.jars.b) into
z.ex.jars.a.Activator with no problems.
Is your plugin B in your target platform (which might still be effected
by the problem Martin mentioned) or are they both in your workspace.
If they're both in your workspace, can you go to your plugin B project,
right click, and use PDE Tools>Update Classpath to make sure your
classpath is correct?
PW
--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Re: Exposing packages from a jar inside a plug-in [message #668387 is a reply to message #667475] |
Thu, 05 May 2011 14:03 |
Raymond Mising name Messages: 59 Registered: July 2009 |
Member |
|
|
I figured out the problem yesterday but not sure if it is an expected behavior or not. In the Bundle-ClassPath of plugin A actually looks like below ( I missed lib1.jar in my previous post):
Bundle-ClassPath: apache-mime4j-0.6.jar,
httpclient-4.0.3.jar,
httpcore-4.0.1.jar,
httpmime-4.0.3.jar,
lib1.jar
lib1.jar is a command line tool jar which requires those apache and http jars. So that in the manifest file of lib.jar, it claims:
Class-Path: ., apache-mime4j-0.6.jar,httpclient-4.0.3.jar,httpcore-4.0.1.ja r,httpmime-4.0.3.jar
This Class-Path definition seemed to ruin the classpath of plug-in A. I also noticed some resource folder of A was not shown in the package explore view. I manually remove this Class-Path element from the manifest of lib1.jar and refresh plug-in A, everything got back to normal. The classes in the exposed package from B can be seen in A and those disappeared resource folder were also back.
So, do you think this is an expected behavior?
Thanks.
|
|
| | | |
Goto Forum:
Current Time: Fri Apr 26 13:46:51 GMT 2024
Powered by FUDForum. Page generated in 0.03486 seconds
|