[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [equinox-dev] How can I embed a JAR in a plugin?

Thank you, Johah,

Actually, the manifest I was using was correct, I just copied it wrong below
(added in by hand and omitted the jar when I wrote it).

But thanks for the tip. Much appreciated. I'll be sure to watch out for that
in my other projects.


Cheers,
David



> -----Original Message-----
> From: jmgrimes@xxxxxxx [mailto:jmgrimes@xxxxxxx]
> Sent: 9 May 2007 21:17
> To: osgi@xxxxxxxxxxx; equinox-dev@xxxxxxxxxxx
> Subject: RE: [equinox-dev] How can I embed a JAR in a plugin?
>
>
> Dave,
>
> I think this manifest probably didn't work because in the
> Bundle-ClassPath references, you omitted the ".jar" extension to the
> lucene-core-2.0.0 JAR file.
>
> We did this some time ago with other third party JARs in the fashion you
> described with success.
>
> Hope this helps,
>
> Jonah
>
> -----Original Message-----
> From: equinox-dev-bounces@xxxxxxxxxxx
> [mailto:equinox-dev-bounces@xxxxxxxxxxx] On Behalf Of David Leangen
> Sent: Wednesday, May 09, 2007 4:23 AM
> To: Alex Blewitt
> Cc: Equinox development mailing list
> Subject: Re: [equinox-dev] How can I embed a JAR in a plugin?
>
>
> Thanks, Alex!
>
> I've been meaning to try out bnd for a while now... I didn't realise
> that it could so easily turn an existing jar into a bundle. Sounds very
> useful! I'll give that a try and compare results.
>
>
> In any case, regarding what I did manually, I forgot to mention that I
> did of course export each of the packages. Here's the manifest I used:
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: net.leangen.expedition.lucene
> Bundle-SymbolicName: net.leangen.expedition.lucene
> Bundle-Version: 1.0.0
> Bundle-Localization: plugin
> Bundle-ClassPath: .,lib/lucene-core-2.0.0
> Export-Package: net.leangen.expedition.lucene;version="1.0.0",
>  org.apache.lucene;version="2.0.0",
>  org.apache.lucene.analysis;version="2.0.0",
>  org.apache.lucene.analysis.standard;version="2.0.0",
>  org.apache.lucene.document;version="2.0.0",
>  org.apache.lucene.index;version="2.0.0",
>  org.apache.lucene.queryParser;version="2.0.0",
>  org.apache.lucene.search;version="2.0.0",
>  org.apache.lucene.search.spans;version="2.0.0",
>  org.apache.lucene.store;version="2.0.0",
>  org.apache.lucene.util;version="2.0.0"
>
>
>
> Cheers!
> Dave
>
>
>
> On Wed, 2007-05-09 at 09:12 +0100, Alex Blewitt wrote:
> > The Bundle-ClassPath gives the bundle visibility, but doesn't export
> > any of the contents. So doing:
> >
> > Bundle-ClassPath: .,thirdparty.jar
> >
> > means that classes inside the bundle will be able to see code in
> > thirdparty.jar, but that doesn't imply any other people who depend on
> > it will see them. You'll need to add
> >
> > Export-Package: com.example.thirdparty,com.example.thirdparty.other
> >
> > for each package that you want to expose.
> >
> > You might find that the 'bnd' tool (http://www.aqute.biz/Code/Bnd),
> > which can automatically convert an existing Jar into an OSGi bundle,
> > might be better suited to your needs.
> >
> > Alex.
> >
> > On 09/05/07, David Leangen <osgi@xxxxxxxxxxx> wrote:
> > >
> > > Since many OSS projects do not package their code as osgi bundles,
> > > I've had to create my own bundles from time to time.
> > >
> > > This time, I thought that rather than including it as a project in
> > > my Eclipse environment, I'll put the bundle in my plugins directory.
> > >
> > >
> > > However, I have not yet been able to figure out how to expose the
> > > classpath of the embedded jar file to my projects in the workspace.
> > >
> > > If I directly compile the code (thus all the class files are in "."
> > > in the bundle rather than in a jar in the bundle), I can include the
>
> > > bundle this way without any problems.
> > >
> > >
> > > I thought that I only needed to include the jar in the
> > > Bundle-ClassPath entry in the manifest, but Equinox does not
> recognize this.
> > >
> > >
> > > What does Equinox require that I do to expose this embedded jar to
> > > my projects in Eclipse via my plugin bundle?
> > >
> > >
> > >
> > > Thank you!
> > > David
> > >
> > >
> > >
> > > _______________________________________________
> > > equinox-dev mailing list
> > > equinox-dev@xxxxxxxxxxx
> > > https://dev.eclipse.org/mailman/listinfo/equinox-dev
> > >
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>