Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How do I wrap jars in a plugin?
How do I wrap jars in a plugin? [message #336804] Fri, 03 July 2009 11:47 Go to next message
Eclipse User
Originally posted by: NOSPAM-magnus.rundlof.saabgroup.com-NOSPAM

Hi all!

I have a jar file that I would like to wrap in a plugin which in turn
exports the packages of that jar file.

I've put my jar on the plugin classpath and updated the build path to export
the jar. I've added all the packages to the Exported-Packages header in the
manifest. Now other projects can import those packages and build...all good
so far...as long as I keep it as a project in my workspace.

But I don't want it as a project in my workspace...I want to export it to a
plugin (or OSGi Bundle to be precise) and put it in my target environment.
If I do so, my dependent plugin projects doesn't build anymore. I can still
import the packages, but the actual classes can not be found (In JDT:
<classname> can not be resolved to a type).

I've heard something about wrapping jars in jars could mean problem so I
tried unzipping my jar and adding the contents as a Class Folder to the
build path, but this way I can't even export my packages.

Please help me, this is driving me crazy...

Regards,
Magnus Rundl
Re: How do I wrap jars in a plugin? [message #336806 is a reply to message #336804] Fri, 03 July 2009 14:29 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
Magnus Rundlof wrote:
> Hi all!
>
> I have a jar file that I would like to wrap in a plugin which in turn
> exports the packages of that jar file.
>
> I've put my jar on the plugin classpath and updated the build path to export
> the jar. I've added all the packages to the Exported-Packages header in the
> manifest. Now other projects can import those packages and build...all good
> so far...as long as I keep it as a project in my workspace.
>
> But I don't want it as a project in my workspace...I want to export it to a
> plugin (or OSGi Bundle to be precise) and put it in my target environment.
> If I do so, my dependent plugin projects doesn't build anymore. I can still
> import the packages, but the actual classes can not be found (In JDT:
> <classname> can not be resolved to a type).
>
> I've heard something about wrapping jars in jars could mean problem so I
> tried unzipping my jar and adding the contents as a Class Folder to the
> build path, but this way I can't even export my packages.
>
> Please help me, this is driving me crazy...
>
> Regards,
> Magnus Rundlöf
>
>
File->New->Project. Select Plugin from Existing JAR Archive.
Re: How do I wrap jars in a plugin? [message #467906 is a reply to message #336804] Mon, 03 August 2009 11:05 Go to previous message
Eclipse User
Originally posted by: NOSPAM-magnus.rundlof.saabgroup.com-NOSPAM

Hi again!

The problem can be solved by having both the jar file and the unzipped class
structure in the bundle. The jar should be on the bundle classpath.

Regards,
Magnus



"Magnus Rundlof" <NOSPAM-magnus.rundlof@saabgroup.com-NOSPAM> wrote in
message news:h2kr58$b6a$1@build.eclipse.org...
> Hi all!
>
> I have a jar file that I would like to wrap in a plugin which in turn
> exports the packages of that jar file.
>
> I've put my jar on the plugin classpath and updated the build path to
> export the jar. I've added all the packages to the Exported-Packages
> header in the manifest. Now other projects can import those packages and
> build...all good so far...as long as I keep it as a project in my
> workspace.
>
> But I don't want it as a project in my workspace...I want to export it to
> a plugin (or OSGi Bundle to be precise) and put it in my target
> environment. If I do so, my dependent plugin projects doesn't build
> anymore. I can still import the packages, but the actual classes can not
> be found (In JDT: <classname> can not be resolved to a type).
>
> I've heard something about wrapping jars in jars could mean problem so I
> tried unzipping my jar and adding the contents as a Class Folder to the
> build path, but this way I can't even export my packages.
>
> Please help me, this is driving me crazy...
>
> Regards,
> Magnus Rundl
Previous Topic:how insert piece of code into the opend editor page
Next Topic:Text editor synchronization problem
Goto Forum:
  


Current Time: Sat Oct 25 17:04:56 GMT 2014

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

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