Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Does Eclipse 3.1.X supports plugins with embedded jars?
Does Eclipse 3.1.X supports plugins with embedded jars? [message #300944] Mon, 20 March 2006 13:08 Go to next message
Eclipse UserFriend
Hi,

I am using Eclipse 3.1.1 and have a plugin A that is created as OSGI
bundle, that is, using the MANIFEST.MF file. The thing is that this
plugin also contains jar files that other plugins can make reference to.
Everything builds fine my workspace. But, when I deploy this plugin
A, which is deployed as a jar file, my other plugins can't see the stuff
in the embedded jar files that plugin A now has. So, does Eclipse
supported embedded jars in a deployed plugin?

Thanks!
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #300945 is a reply to message #300944] Mon, 20 March 2006 13:16 Go to previous messageGo to next message
Eclipse UserFriend
AL wrote:
> Hi,
>
> I am using Eclipse 3.1.1 and have a plugin A that is created as OSGI
> bundle, that is, using the MANIFEST.MF file. The thing is that this
> plugin also contains jar files that other plugins can make reference to.
> Everything builds fine my workspace. But, when I deploy this plugin A,
> which is deployed as a jar file, my other plugins can't see the stuff in
> the embedded jar files that plugin A now has. So, does Eclipse
> supported embedded jars in a deployed plugin?

Yes it does, but the 3rd party jar needs to be added in the right way.

I use a checklist like this one
http://dev.eclipse.org/newslists/news.eclipse.platform/msg48 366.html

Plugin A has the jars. Plugin A lists them in the Bundle-ClassPath.
Plugin A would export packages from the jars. (PDE Tools udpates the
classpath)

Plugin B requires Plugin A ... it now has access to the exported
packages from Plugin A.

Later,
PW
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #300948 is a reply to message #300945] Mon, 20 March 2006 14:16 Go to previous messageGo to next message
Eclipse UserFriend
Paul Webster wrote:

> AL wrote:
>
>> Hi,
>>
>> I am using Eclipse 3.1.1 and have a plugin A that is created as OSGI
>> bundle, that is, using the MANIFEST.MF file. The thing is that this
>> plugin also contains jar files that other plugins can make reference
>> to. Everything builds fine my workspace. But, when I deploy this
>> plugin A, which is deployed as a jar file, my other plugins can't see
>> the stuff in the embedded jar files that plugin A now has. So, does
>> Eclipse supported embedded jars in a deployed plugin?
>
>
> Yes it does, but the 3rd party jar needs to be added in the right way.
>
> I use a checklist like this one
> http://dev.eclipse.org/newslists/news.eclipse.platform/msg48 366.html
>
> Plugin A has the jars. Plugin A lists them in the Bundle-ClassPath.
> Plugin A would export packages from the jars. (PDE Tools udpates the
> classpath)
>
> Plugin B requires Plugin A ... it now has access to the exported
> packages from Plugin A.
>
> Later,
> PW

Thanks very much...I read the link you included above and it looks like
option 2 below is what I have to do. I do have some questions. (1) It
seems like the below option is making use only of the plugin.xml rather
than the MANIFEST.MF file? (2) You mentioned not to "Package plug-ins as
individual JAR archives" when exporting out the plugin. Well, the
problem is I build and export my plugins via my update project. So, I
don't know if there if there is a way to off ""Package plug-ins as
individual JAR archives" option.

---------------------------------------------
"Option 2: include the jars in a plugin
1. Use Import>File System to import the jar files into your plugin
project, say in the <project>/lib directory.
2. Use "Add..." to add the jars to the classpath section of the
plugin.xml>Runtime tab.
3. Use "New..." to add "." library back (with no quotes, of course).
4. make sure your binary build exports the new jar files on the
plugin.xml>Build tab.
5. save
6. on the project, use context menu>PDE Tools>Update Classpath to
correctly add the jars to the eclipse project classpath.

When you export an Option 2 plugin for deployment, make sure you don't
"Package plug-ins as individual JAR archives" ... eclipse can't load a
jar from within a plugin jar.
"
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #300951 is a reply to message #300948] Mon, 20 March 2006 14:43 Go to previous messageGo to next message
Eclipse UserFriend
AL wrote:
>
>
> Thanks very much...I read the link you included above and it looks like
> option 2 below is what I have to do. I do have some questions. (1) It
> seems like the below option is making use only of the plugin.xml rather
> than the MANIFEST.MF file? (2) You mentioned not to "Package plug-ins as
> individual JAR archives" when exporting out the plugin. Well, the
> problem is I build and export my plugins via my update project. So, I
> don't know if there if there is a way to off ""Package plug-ins as
> individual JAR archives" option.

Sorry, it's not clear in the list but in 3.x, the plugin.xml>Runtime tab
actually is the MANIFEST.MF>Runtime tab ... If you open your plugin.xml,
the Runtime tab still points to the manifest file. If you don't have a
manifest file, there are options like the "project popup menu>PDE
Tools>Migrate to 3.0" that can turn a 2.x plugin.xml runtime section
into a manifest file.


And that last statement in the list is incorrect. Please ignore:
> When you export an Option 2 plugin for deployment, make sure you don't
> "Package plug-ins as individual JAR archives" ... eclipse can't load a
> jar from within a plugin jar.

Eclipse can load a jar from within a plugin jar, this list must be back
from when I thought it couldn't :-)

Later,
PW
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #300952 is a reply to message #300951] Mon, 20 March 2006 15:28 Go to previous messageGo to next message
Eclipse UserFriend
Paul there seems to be confliction of lack of information on whether
this really works. such as

http://www.eclipse.org/eclipse/platform-core/documents/3.1/r un_from_jars.html

says under issues:

"JARs within JARs - The JAR'd plug-in format requires the class files to
exist starting at the root of the JAR file. Some plug-ins have multiple
JARs and its an issue to have nested JARs. Have to come up with a
strategy for this."


So..if we follow option two that I should be able to make a single jar
of my plug-in even if it contains a /lib folder with jars in it and it
should work at run time?




Paul Webster wrote:

>
> And that last statement in the list is incorrect. Please ignore:
> > When you export an Option 2 plugin for deployment, make sure you don't
> > "Package plug-ins as individual JAR archives" ... eclipse can't load a
> > jar from within a plugin jar.
>
> Eclipse can load a jar from within a plugin jar, this list must be back
> from when I thought it couldn't :-)
>
> Later,
> PW
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #300953 is a reply to message #300945] Mon, 20 March 2006 16:56 Go to previous messageGo to next message
Eclipse UserFriend
Paul Webster wrote:
> AL wrote:
>
>> Hi,
>>
>> I am using Eclipse 3.1.1 and have a plugin A that is created as OSGI
>> bundle, that is, using the MANIFEST.MF file. The thing is that this
>> plugin also contains jar files that other plugins can make reference
>> to. Everything builds fine my workspace. But, when I deploy this
>> plugin A, which is deployed as a jar file, my other plugins can't see
>> the stuff in the embedded jar files that plugin A now has. So, does
>> Eclipse supported embedded jars in a deployed plugin?
>
>
> Yes it does, but the 3rd party jar needs to be added in the right way.
>
> I use a checklist like this one
> http://dev.eclipse.org/newslists/news.eclipse.platform/msg48 366.html
>
> Plugin A has the jars. Plugin A lists them in the Bundle-ClassPath.
> Plugin A would export packages from the jars. (PDE Tools udpates the
> classpath)
>
> Plugin B requires Plugin A ... it now has access to the exported
> packages from Plugin A.
>
> Later,
> PW

I am sorry...I am bit a confused. Thanks very much so far for your tips
and help, but, here is my situation:

I created a plugin A with OSGI bundle support. In this plugin, I have a
directory called "jars" which has 3rd party jar files in it. I use the
manifest editor to add all the classpaths, that is, "jars/a.jar",
"jars/b.jar", etc., and see that 'Bundle-ClassPath' has the entries.

Scenario 1:
-----------

Ok, now within this plugin A, I have a Java class that imports a class
from one of the jar files in the 'jars' directory. I have an error that
the Java editor cannot see the import. So, I can compile plugin A in
the workspace. I have to add the jars via the 'Build Path->Configure
Build Path' menu. So, my question: This step is required???

Scenario 2:
-----------

I have plugin B that depends on plugin A and wants to use the classes
from the 3rd party jars that reside in plugin A.

So, I add plugin A as a dependency into plugin B.

Again, in plugin B, I have a Java class that uses a class from one of
the third party jars in plugin A. I have error, unless I add the jars
via the 'Build Path->Configure Build Path' menu in order to build plugin
B successfully in the workspace. So, My question: it seems like Eclipse
requires me to do this???

Scenario 3:
-----------

Now, I export and deploy plugin A by doing a build on my update site
project, which ultimately builds the plugins A and B in my feature project.

I update my Eclipse installation with the stuff from the update site,
that is, plugin A and B.

I see that plugin A is updated into my Eclipse installation as a
separate directory, that is, NOT as a single jar. This is good and what
I am looking for.

I remove plugin A from my workspace. BAM! Plugin B in my workspace now
has errors. I go into plugin B's build path via "Build Path->Configure
Build Path' and click on the 'Libraries' tab. And remove the entries
that references to plugin A's jars. Now that plugin A is deployed,
Eclipse only looks at what's under 'Plug-in Dependencies'.

Now that I import in plugin A's project into my workspace. BAM! Plugin
B now has errors. I have to an 'Add Jars' via the "Build
Path->Configure Path' menu and click on the 'Add Jars' button to add the
jar references from plugin A. Again, why is this required by Eclipse
when plugin A's project is present in the workspace?

Thanks!
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #300970 is a reply to message #300953] Tue, 21 March 2006 07:59 Go to previous messageGo to next message
Eclipse UserFriend
AL wrote:
> Paul Webster wrote:
>
>> AL wrote:
>>
>>> Hi,
>>>
>>> I am using Eclipse 3.1.1 and have a plugin A that is created as OSGI
>>> bundle, that is, using the MANIFEST.MF file. The thing is that this
>>> plugin also contains jar files that other plugins can make reference
>>> to. Everything builds fine my workspace. But, when I deploy this
>>> plugin A, which is deployed as a jar file, my other plugins can't see
>>> the stuff in the embedded jar files that plugin A now has. So, does
>>> Eclipse supported embedded jars in a deployed plugin?
>>
>>
>>
>> Yes it does, but the 3rd party jar needs to be added in the right way.
>>
>> I use a checklist like this one
>> http://dev.eclipse.org/newslists/news.eclipse.platform/msg48 366.html
>>
>> Plugin A has the jars. Plugin A lists them in the Bundle-ClassPath.
>> Plugin A would export packages from the jars. (PDE Tools udpates the
>> classpath)
>>
>> Plugin B requires Plugin A ... it now has access to the exported
>> packages from Plugin A.
>>
>> Later,
>> PW
>
>
> I am sorry...I am bit a confused. Thanks very much so far for your tips
> and help, but, here is my situation:
>
> I created a plugin A with OSGI bundle support. In this plugin, I have a
> directory called "jars" which has 3rd party jar files in it. I use the
> manifest editor to add all the classpaths, that is, "jars/a.jar",
> "jars/b.jar", etc., and see that 'Bundle-ClassPath' has the entries.
>
> Scenario 1:
> -----------
>
> Ok, now within this plugin A, I have a Java class that imports a class
> from one of the jar files in the 'jars' directory. I have an error that
> the Java editor cannot see the import. So, I can compile plugin A in
> the workspace. I have to add the jars via the 'Build Path->Configure
> Build Path' menu. So, my question: This step is required???


This step will lead you to nothing but trouble, that's why it's not in
the list steps.

you should have added the jars to the build path using the project popup
menu>PDE Tools>Update classpath... otherwise you've only done about
half of what's needed.

Really, lists only work if you follow the steps :-) The other problems
will follow ... for example, if you are adding Project A jars directly
to the Project B build path, you're just not set up correctly and it
won't work.

A little background on why you are running into this problem. There are
2 different features involved with creating plugins, PDE and JDT. PDE
is about plugins and eclipse and OSGi and runtime classpaths. JDT is
about java projects and build time classpaths and compiling and editing
java code.

PDE depends on JDT, but JDT doesn't really see PDE (you can have a java
project without being an eclipse plugin).

When you use the manifest editor and update the plugin classpath and
export packages on the Runtime tab, you're setting up PDE.

But JDT requires 2 things to work ... the build path Libraries tab must
be correct, and the build path Order and Export tab must be correct.
Once the project jars are in the Libraries tab and exported from the
Order and Export tab, all another java project (plugin or not) needs to
do to compile properly is list the project in it's dependencies.

That's why you set up PDE, and the use PDE Tools>Update classpath... for
eclipse to correctly change your project build path to reflect the valid
runtime path.

Later,
PW
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #300971 is a reply to message #300952] Tue, 21 March 2006 08:12 Go to previous messageGo to next message
Eclipse UserFriend
Mike Boyersmith wrote:
> Paul there seems to be confliction of lack of information on whether
> this really works. such as

I deployed a plugin with a jar in a jar on 3.1.2 and it worked ... I'm
positive it works in 3.1.1, and I'm pretty sure it works in 3.1.0

The only other hiccup I noticed was that you needed to do step 6 (PDE
Tools>Update Classpath...) before you can add the jar packages to the
export packages section.

Later,
PW
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #300992 is a reply to message #300971] Tue, 21 March 2006 11:44 Go to previous messageGo to next message
Eclipse UserFriend
Ok, will try it out. Thanks again Paul for your time and technical
knowledge, its much appreciated.




Paul Webster wrote:
> Mike Boyersmith wrote:
>
>> Paul there seems to be confliction of lack of information on whether
>> this really works. such as
>
>
> I deployed a plugin with a jar in a jar on 3.1.2 and it worked ... I'm
> positive it works in 3.1.1, and I'm pretty sure it works in 3.1.0
>
> The only other hiccup I noticed was that you needed to do step 6 (PDE
> Tools>Update Classpath...) before you can add the jar packages to the
> export packages section.
>
> Later,
> PW
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #300993 is a reply to message #300970] Tue, 21 March 2006 11:53 Go to previous messageGo to next message
Eclipse UserFriend
Paul Webster wrote:

> AL wrote:
>
>> Paul Webster wrote:
>>
>>> AL wrote:
>>>
>>>> Hi,
>>>>
>>>> I am using Eclipse 3.1.1 and have a plugin A that is created as OSGI
>>>> bundle, that is, using the MANIFEST.MF file. The thing is that this
>>>> plugin also contains jar files that other plugins can make reference
>>>> to. Everything builds fine my workspace. But, when I deploy this
>>>> plugin A, which is deployed as a jar file, my other plugins can't
>>>> see the stuff in the embedded jar files that plugin A now has. So,
>>>> does Eclipse supported embedded jars in a deployed plugin?
>>>
>>>
>>>
>>>
>>> Yes it does, but the 3rd party jar needs to be added in the right way.
>>>
>>> I use a checklist like this one
>>> http://dev.eclipse.org/newslists/news.eclipse.platform/msg48 366.html
>>>
>>> Plugin A has the jars. Plugin A lists them in the Bundle-ClassPath.
>>> Plugin A would export packages from the jars. (PDE Tools udpates the
>>> classpath)
>>>
>>> Plugin B requires Plugin A ... it now has access to the exported
>>> packages from Plugin A.
>>>
>>> Later,
>>> PW
>>
>>
>>
>> I am sorry...I am bit a confused. Thanks very much so far for your
>> tips and help, but, here is my situation:
>>
>> I created a plugin A with OSGI bundle support. In this plugin, I have
>> a directory called "jars" which has 3rd party jar files in it. I use
>> the manifest editor to add all the classpaths, that is, "jars/a.jar",
>> "jars/b.jar", etc., and see that 'Bundle-ClassPath' has the entries.
>>
>> Scenario 1:
>> -----------
>>
>> Ok, now within this plugin A, I have a Java class that imports a class
>> from one of the jar files in the 'jars' directory. I have an error
>> that the Java editor cannot see the import. So, I can compile plugin
>> A in the workspace. I have to add the jars via the 'Build
>> Path->Configure Build Path' menu. So, my question: This step is
>> required???
>
>
>
> This step will lead you to nothing but trouble, that's why it's not in
> the list steps.
>
> you should have added the jars to the build path using the project popup
> menu>PDE Tools>Update classpath... otherwise you've only done about
> half of what's needed.
>

Paul, thanks for the tips. Actually you don't need to do a menu>PDE
Tools>Update classpath, because doing a 'Build Path->Configure Build
Path->Add Jars' will automatically do it for you.

Do you have any comments/tips for scenarios #2 and #3 in previous post?

> Really, lists only work if you follow the steps :-) The other problems
> will follow ... for example, if you are adding Project A jars directly
> to the Project B build path, you're just not set up correctly and it
> won't work.
>
> A little background on why you are running into this problem. There are
> 2 different features involved with creating plugins, PDE and JDT. PDE
> is about plugins and eclipse and OSGi and runtime classpaths. JDT is
> about java projects and build time classpaths and compiling and editing
> java code.
>
> PDE depends on JDT, but JDT doesn't really see PDE (you can have a java
> project without being an eclipse plugin).
>
> When you use the manifest editor and update the plugin classpath and
> export packages on the Runtime tab, you're setting up PDE.
>
> But JDT requires 2 things to work ... the build path Libraries tab must
> be correct, and the build path Order and Export tab must be correct.
> Once the project jars are in the Libraries tab and exported from the
> Order and Export tab, all another java project (plugin or not) needs to
> do to compile properly is list the project in it's dependencies.
>
> That's why you set up PDE, and the use PDE Tools>Update classpath... for
> eclipse to correctly change your project build path to reflect the valid
> runtime path.
>
> Later,
> PW
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #300994 is a reply to message #300993] Tue, 21 March 2006 12:40 Go to previous messageGo to next message
Eclipse UserFriend
AL wrote:
> Paul Webster wrote:
>>
>>
>>
>>
>> This step will lead you to nothing but trouble, that's why it's not in
>> the list steps.
>>
>> you should have added the jars to the build path using the project
>> popup menu>PDE Tools>Update classpath... otherwise you've only done
>> about half of what's needed.
>>
>
> Paul, thanks for the tips. Actually you don't need to do a menu>PDE
> Tools>Update classpath, because doing a 'Build Path->Configure Build
> Path->Add Jars' will automatically do it for you.

Sigh ... it only does half the job, which is why I said "This step will
lead you to nothing but trouble ..."

What I should have said was ... Remove it from the build path>Libraries
tab, then go back and add it using PDE Tools. That's an ORDER, cadet!

>
> Do you have any comments/tips for scenarios #2 and #3 in previous post?
>

Yes, Scenario 2 won't work unless you get the order+export tab correct
in scenario 1 ... which is done for you automatically if you follow the
list, and not done for you if you ignore the steps.


When creating plugin B, the ONLY step is to add a plugin dependency on
plugin A in the manifest>Dependencies tab ... there are no other
classpath related steps.

If you've set up the PDE info correctly (plugin A has the correct bundle
classpath and exports the correct packages) then plugin B will
automagically be able to import classes from plugin A.

Later,
PW
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #300995 is a reply to message #300970] Tue, 21 March 2006 13:02 Go to previous messageGo to next message
Eclipse UserFriend
Just wanted to thank you, Paul, for your tips and help! (Let's try out
the exact steps you listed and will let you know.)

thanks again!

Paul Webster wrote:
> AL wrote:
>
>> Paul Webster wrote:
>>
>>> AL wrote:
>>>
>>>> Hi,
>>>>
>>>> I am using Eclipse 3.1.1 and have a plugin A that is created as OSGI
>>>> bundle, that is, using the MANIFEST.MF file. The thing is that this
>>>> plugin also contains jar files that other plugins can make reference
>>>> to. Everything builds fine my workspace. But, when I deploy this
>>>> plugin A, which is deployed as a jar file, my other plugins can't
>>>> see the stuff in the embedded jar files that plugin A now has. So,
>>>> does Eclipse supported embedded jars in a deployed plugin?
>>>
>>>
>>>
>>>
>>> Yes it does, but the 3rd party jar needs to be added in the right way.
>>>
>>> I use a checklist like this one
>>> http://dev.eclipse.org/newslists/news.eclipse.platform/msg48 366.html
>>>
>>> Plugin A has the jars. Plugin A lists them in the Bundle-ClassPath.
>>> Plugin A would export packages from the jars. (PDE Tools udpates the
>>> classpath)
>>>
>>> Plugin B requires Plugin A ... it now has access to the exported
>>> packages from Plugin A.
>>>
>>> Later,
>>> PW
>>
>>
>>
>> I am sorry...I am bit a confused. Thanks very much so far for your
>> tips and help, but, here is my situation:
>>
>> I created a plugin A with OSGI bundle support. In this plugin, I have
>> a directory called "jars" which has 3rd party jar files in it. I use
>> the manifest editor to add all the classpaths, that is, "jars/a.jar",
>> "jars/b.jar", etc., and see that 'Bundle-ClassPath' has the entries.
>>
>> Scenario 1:
>> -----------
>>
>> Ok, now within this plugin A, I have a Java class that imports a class
>> from one of the jar files in the 'jars' directory. I have an error
>> that the Java editor cannot see the import. So, I can compile plugin
>> A in the workspace. I have to add the jars via the 'Build
>> Path->Configure Build Path' menu. So, my question: This step is
>> required???
>
>
>
> This step will lead you to nothing but trouble, that's why it's not in
> the list steps.
>
> you should have added the jars to the build path using the project popup
> menu>PDE Tools>Update classpath... otherwise you've only done about
> half of what's needed.
>
> Really, lists only work if you follow the steps :-) The other problems
> will follow ... for example, if you are adding Project A jars directly
> to the Project B build path, you're just not set up correctly and it
> won't work.
>
> A little background on why you are running into this problem. There are
> 2 different features involved with creating plugins, PDE and JDT. PDE
> is about plugins and eclipse and OSGi and runtime classpaths. JDT is
> about java projects and build time classpaths and compiling and editing
> java code.
>
> PDE depends on JDT, but JDT doesn't really see PDE (you can have a java
> project without being an eclipse plugin).
>
> When you use the manifest editor and update the plugin classpath and
> export packages on the Runtime tab, you're setting up PDE.
>
> But JDT requires 2 things to work ... the build path Libraries tab must
> be correct, and the build path Order and Export tab must be correct.
> Once the project jars are in the Libraries tab and exported from the
> Order and Export tab, all another java project (plugin or not) needs to
> do to compile properly is list the project in it's dependencies.
>
> That's why you set up PDE, and the use PDE Tools>Update classpath... for
> eclipse to correctly change your project build path to reflect the valid
> runtime path.
>
> Later,
> PW
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #301098 is a reply to message #300994] Thu, 23 March 2006 13:46 Go to previous messageGo to next message
Eclipse UserFriend
Paul Webster wrote:

> AL wrote:
>
>> Paul Webster wrote:
>>
>>>
>>>
>>>
>>>
>>> This step will lead you to nothing but trouble, that's why it's not
>>> in the list steps.
>>>
>>> you should have added the jars to the build path using the project
>>> popup menu>PDE Tools>Update classpath... otherwise you've only done
>>> about half of what's needed.
>>>
>>
>> Paul, thanks for the tips. Actually you don't need to do a menu>PDE
>> Tools>Update classpath, because doing a 'Build Path->Configure Build
>> Path->Add Jars' will automatically do it for you.
>
>
> Sigh ... it only does half the job, which is why I said "This step will
> lead you to nothing but trouble ..."
>
> What I should have said was ... Remove it from the build path>Libraries
> tab, then go back and add it using PDE Tools. That's an ORDER, cadet!
>
>>
>> Do you have any comments/tips for scenarios #2 and #3 in previous post?
>>
>
> Yes, Scenario 2 won't work unless you get the order+export tab correct
> in scenario 1 ... which is done for you automatically if you follow the
> list, and not done for you if you ignore the steps.
>
>
> When creating plugin B, the ONLY step is to add a plugin dependency on
> plugin A in the manifest>Dependencies tab ... there are no other
> classpath related steps.
>
> If you've set up the PDE info correctly (plugin A has the correct bundle
> classpath and exports the correct packages) then plugin B will
> automagically be able to import classes from plugin A.
>
> Later,
> PW

Ok, Paul...I followed your steps...Works great, but, now I have another
problem with a different scenario.

Plugin A has a 3rd party jar--a.jar. I also have a fragment whose host
is plugin A. The fragment also has a 3rd party jar, b.jar.

Plugin B depends on plugin A and is able to reference classes in a.jar
in plugin A, based on the steps you outlined. But it is not able to
reference classes in the b.jar from the fragment. The same for plugin A.

I would think that since plugin B depends on plugin A and the fragment
already specifies plugin A as its host, shouldn't plugins A and B be
able to reference classes in b.jar from the fragment?

THANKS!
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #301162 is a reply to message #301098] Fri, 24 March 2006 07:13 Go to previous messageGo to next message
Eclipse UserFriend
AL wrote:
>
> Ok, Paul...I followed your steps...Works great, but, now I have another
> problem with a different scenario.
>
> Plugin A has a 3rd party jar--a.jar. I also have a fragment whose host
> is plugin A. The fragment also has a 3rd party jar, b.jar.
>
> Plugin B depends on plugin A and is able to reference classes in a.jar
> in plugin A, based on the steps you outlined. But it is not able to
> reference classes in the b.jar from the fragment. The same for plugin A.
>
> I would think that since plugin B depends on plugin A and the fragment
> already specifies plugin A as its host, shouldn't plugins A and B be
> able to reference classes in b.jar from the fragment?
>
> THANKS!

That won't work ... at least not the way you want. Fragments are
totally optional. That means that whatever you have has to be able to
compile and run without them available. That applies to both plugin A
and plugin B.

A fragment is a way to take optional content (like a number of different
drivers, say) and when loaded merge them into the host plugin as if they
had been part of that plugin all along.

But that means the interfaces that would allow someone to use the
drivers must be in the host plugin, not the fragment. The fragment
would supply or register factories, for example.

Another example of use is eclipse uses fragments to supply i18n language
packs. The appropriate classes and message resource bundles are
suddenly on the classpath, for when the user uses -nl de_DE


Later,
PW
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #301207 is a reply to message #301162] Fri, 24 March 2006 13:43 Go to previous messageGo to next message
Eclipse UserFriend
Paul Webster wrote:

> AL wrote:
>
>>
>> Ok, Paul...I followed your steps...Works great, but, now I have
>> another problem with a different scenario.
>>
>> Plugin A has a 3rd party jar--a.jar. I also have a fragment whose
>> host is plugin A. The fragment also has a 3rd party jar, b.jar.
>>
>> Plugin B depends on plugin A and is able to reference classes in a.jar
>> in plugin A, based on the steps you outlined. But it is not able to
>> reference classes in the b.jar from the fragment. The same for plugin A.
>>
>> I would think that since plugin B depends on plugin A and the fragment
>> already specifies plugin A as its host, shouldn't plugins A and B be
>> able to reference classes in b.jar from the fragment?
>>
>> THANKS!
>
>
> That won't work ... at least not the way you want. Fragments are
> totally optional. That means that whatever you have has to be able to
> compile and run without them available. That applies to both plugin A
> and plugin B.
>
> A fragment is a way to take optional content (like a number of different
> drivers, say) and when loaded merge them into the host plugin as if they
> had been part of that plugin all along.
>
> But that means the interfaces that would allow someone to use the
> drivers must be in the host plugin, not the fragment. The fragment
> would supply or register factories, for example.
>
> Another example of use is eclipse uses fragments to supply i18n language
> packs. The appropriate classes and message resource bundles are
> suddenly on the classpath, for when the user uses -nl de_DE
>
>
> Later,
> PW

So, for my scenario to work, I need to make the fragment a plugin, like
plugin A? Or is there another way to make my scenario work with the
fragment?

Thanks!
Re: Does Eclipse 3.1.X supports plugins with embedded jars? [message #301214 is a reply to message #301207] Fri, 24 March 2006 14:20 Go to previous message
Eclipse UserFriend
AL wrote:
>
>
> So, for my scenario to work, I need to make the fragment a plugin, like
> plugin A? Or is there another way to make my scenario work with the
> fragment?

You can either make it another 3rd party jar in plugin A or create
another 3rd party jar plugin for you b.jar.

Later,
PW
Previous Topic:how to programmtically set selection in a FormText?
Next Topic:Open View, and bring it to front?
Goto Forum:
  


Current Time: Sun Nov 09 11:23:13 EST 2025

Powered by FUDForum. Page generated in 0.05894 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top