Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Export Plugin with external jars in a single jar-plugin
Export Plugin with external jars in a single jar-plugin [message #436770] Sun, 18 September 2005 11:12 Go to next message
Markus Wolf is currently offline Markus WolfFriend
Messages: 153
Registered: July 2009
Senior Member
Hi there,

is there a way to create a plugin depending on external jars (e.g.
spring.jar in my case) and export it as single jar file?
All documentation says it is just as easy as adding it to the classpath
in the runtime configuration tab of the manifest-editor, but this
restricts the ability to export as jar and only will export the plugin
as folder.
Any help or idea? Maybe I miss something?

Regards
Markus Wolf
--
>
> emedia-solutions wolf
> Wedeler Landstrasse 63
> 22559 Hamburg
>
>> phone: (+49) 40 550 083 70
>> web: http://www.emedia-solutions-wolf.de
>> mail: markus@emedia-solutions-wolf.de
>> pgp: http://wwwkeys.de.pgp.net
>
Re: Export Plugin with external jars in a single jar-plugin [message #436773 is a reply to message #436770] Sun, 18 September 2005 15:24 Go to previous messageGo to next message
Haris Peco is currently offline Haris PecoFriend
Messages: 1072
Registered: July 2009
Senior Member
Markus Wolf wrote:

> Hi there,
>
> is there a way to create a plugin depending on external jars (e.g.
> spring.jar in my case) and export it as single jar file?
> All documentation says it is just as easy as adding it to the classpath
> in the runtime configuration tab of the manifest-editor, but this
> restricts the ability to export as jar and only will export the plugin
> as folder.
> Any help or idea? Maybe I miss something?
>
> Regards
> Markus Wolf

it isn't possible (for now)
Re: Export Plugin with external jars in a single jar-plugin [message #436774 is a reply to message #436773] Sun, 18 September 2005 13:37 Go to previous messageGo to next message
Markus Wolf is currently offline Markus WolfFriend
Messages: 153
Registered: July 2009
Senior Member
>>is there a way to create a plugin depending on external jars (e.g.
>>spring.jar in my case) and export it as single jar file?
>>All documentation says it is just as easy as adding it to the classpath
>>in the runtime configuration tab of the manifest-editor, but this
>>restricts the ability to export as jar and only will export the plugin
>>as folder.
>>Any help or idea? Maybe I miss something?
>
> it isn't possible (for now)
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
--
>
> emedia-solutions wolf
> Wedeler Landstrasse 63
> 22559 Hamburg
>
>> phone: (+49) 40 550 083 70
>> web: http://www.emedia-solutions-wolf.de
>> mail: markus@emedia-solutions-wolf.de
>> pgp: http://wwwkeys.de.pgp.net
>
Re: Export Plugin with external jars in a single jar-plugin [message #436855 is a reply to message #436774] Sun, 18 September 2005 16:16 Go to previous messageGo to next message
Haris Peco is currently offline Haris PecoFriend
Messages: 1072
Registered: July 2009
Senior Member
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
it is possible. Your plugin is jarred, but thirdparty plugin (with jar )
isn't.You can't make web start, for example
Re: Export Plugin with external jars in a single jar-plugin [message #436862 is a reply to message #436855] Mon, 19 September 2005 10:34 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
It's also possible to export a plugin as a single Jar by importing the contents of the JAr file. So instead of:

MyPlugin\external.jar
MyPlugin\org\example\Example.class

you have

MyPlugin\org\external\Library.class
MyPlugin\org\example\Example.class

You can then set the plugin library to '.' in the plugin and export it as a single (unexpanded) Jar.

Of course, having it as an external plugin is probably a good idea down the line, because then you can set up your future projects to depend on the same library.
Re: Export Plugin with external jars in a single jar-plugin [message #436867 is a reply to message #436774] Mon, 19 September 2005 12:26 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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


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 Go to previous messageGo to next message
James Norris is currently offline James NorrisFriend
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
Re: Export Plugin with external jars in a single jar-plugin [message #436878 is a reply to message #436862] Mon, 19 September 2005 16:42 Go to previous messageGo to next message
Markus Wolf is currently offline Markus WolfFriend
Messages: 153
Registered: July 2009
Senior Member
> It's also possible to export a plugin as a single Jar by importing the contents of the JAr file. So instead of:
>
> MyPlugin\external.jar
> MyPlugin\org\example\Example.class
>
> you have
>
> MyPlugin\org\external\Library.class
> MyPlugin\org\example\Example.class
>
> You can then set the plugin library to '.' in the plugin and export it as a single (unexpanded) Jar.
>
> Of course, having it as an external plugin is probably a good idea down the line, because then you can set up your future projects to depend on the same library.
That's what I meant with my last posting. Thanks for clearing up this
once more and a bit better. :-)

Also with this aproach webstart is possible.

Markus Wolf
--
>
> emedia-solutions wolf
> Wedeler Landstrasse 63
> 22559 Hamburg
>
>> phone: (+49) 40 550 083 70
>> web: http://www.emedia-solutions-wolf.de
>> mail: markus@emedia-solutions-wolf.de
>> pgp: http://wwwkeys.de.pgp.net
>
Re: Export Plugin with external jars in a single jar-plugin [message #436879 is a reply to message #436770] Mon, 19 September 2005 16:47 Go to previous message
Markus Wolf is currently offline Markus WolfFriend
Messages: 153
Registered: July 2009
Senior Member
I think a good way to handle this (jar in jar) with thirdparty libraries
is the one knopflerfish is going.
There the 'jar in jar' files where loaded into memory and served from
there. This increases the memory footprint and stands against library
reusage between different plugins but sometimes it's just what a
developer wants.

Anyway importing a jar as plugin using the wizard solves my problem. :-)

Markus Wolf
--
>
> emedia-solutions wolf
> Wedeler Landstrasse 63
> 22559 Hamburg
>
>> phone: (+49) 40 550 083 70
>> web: http://www.emedia-solutions-wolf.de
>> mail: markus@emedia-solutions-wolf.de
>> pgp: http://wwwkeys.de.pgp.net
>
Previous Topic:How to remove fastview programmatically
Next Topic:OSGi documentation
Goto Forum:
  


Current Time: Fri Dec 06 05:01:06 GMT 2024

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

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

Back to the top