|
|
|
|
|
|
Re: Export Plugin with external jars in a single jar-plugin [message #436875 is a reply to message #436867] |
Mon, 19 September 2005 14:54 |
James Norris Messages: 52 Registered: July 2009 |
Member |
|
|
Importing 3rd party jars as plugins has it's problems too. In my case,
sometimes they work and sometimes they don't. For example I have a plugin
created from the plugin wizard based on hibernate3 and it works ok with one
of my plugins that reference it, yet it doesn't work with another plugin
that is setup exactly the same way. Same thing with a logging plugin that I
created. In both cases I have everything setup the same between the various
plugins as far as the buddy stuff goes as suggested in several other
threads. All of the packages are exported, etc. For the hibernate plugin I
also added the class.forName() for the session factory in the start method
of the plugins that reference it based on info in another thread and still I
have problems with classes or files such as hibernate.cfg.xml not found.
Since I had to get something working I finally gave up on the plugin
approach and added them in a lib folder in the project.
IMHO, the eclipse platform really should be able to handle 3rd party jars in
a simple, reliable way if developers are going to create production-ready
applications using it, but I have to conclude that it doesn't at this point
in time. I've spent many wasted hours trying to get the plugin approach to
work before I gave up on it. Too bad because I get tired of adding jars to
every project and would like to be able to simply reference another plugin
even if I have to keep the plugin open in the workspace. It wouldn't be so
bad if eclipse picked up jars added to the build path and automatically
added them to plugin.xml in a way that they worked. If I have a library jar
in the build path and it is within the project's file structure (e.g. in a
lib folder) I should be able to tell eclipse to include the jar
automatically and use it in the classloader for the plugin. Instead, I have
found that you have to go the the runtime tab, add the jars to the
Classpath, then go to the build tab, add the jars to the Binary Build and
then also add them as Extra ClassPath Entries before everything seems to
work. Quite a pain if you have a large number of jars that need to be
included.
I have to wonder if the eclipse plugins that still are deployed as a
directory stucture instead of a jar don't have the same classloader issues
referencing other jar files. Based on the large number of threads about the
3rd party jar issue I think it would be extremely beneficial and helpful if
someone on the eclipse team would publish a step-by-step tutorial on how to
add 3rd party jars in a way that simply works and works the same way all the
time. It should illustrate a chain of plugin references too, such as PlugIn
A references PlugIn B which references PlugIn C, etc. and note things like
where dependency ordering matters and what needs to be set where.
-Jim
"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:dgmar1$35i$1@news.eclipse.org...
> Markus Wolf wrote:
>> Thanks for the answer.
>> Just as a sidenote (I've discovered it while just trying) it is possible
>> to import a thirdparty jar as plugin and use it as is. Then let your
>> plugin depend on the 'thirdparty plugin' and you are done.
>> You can export your own plugin as single-jar then. :-)
>> The docs should be a bit better on this.
>>
>> Markus Wolf
>
> You're correct, I think this was mostly documented in the "What's New"
> section of eclipse 3.1.
>
> But I think it is the new and improved way to get 3rd party jars into a
> plugin ... use New>Project>Plug-in from existing jar archives.
>
> There have been a couple of threads recently of the other way (a plugin
> with jars inside it) but those plugins are always deployed as a directory
> structure (not to mention they have a lot of steps that may or may not
> work).
>
> Later,
> PW
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04885 seconds