Struggling with converting lib jar to bundle [message #77560] |
Fri, 17 November 2006 17:59  |
Eclipse User |
|
|
|
Originally posted by: bill.kayser.ca.com
I want to convert the apache collections library to a plug-in project
whose bundle can still be used as a library by non-osgi clients.
I imported the jar file into the new plug-in project so the classpath is
at the root of the project--the "org" folder is in the root directory.
When I set up the manifest to find classes in the root directory I have
two problems:
1) The IDE does not add the classes to the project classpath.
2) The PDE build does not resolve the classes.
However when I export the project as a plug-in and put that in the
plug-ins directory of the base, the PDE build finds the classes and
everything compiles okay.
I can solve (1) by adding the root directory to the libraries in the
java build path of the project.
But (2) has me stumped.
Am I taking the wrong approach? If I just embed the collections jar
file in the bundle and add it to the classpath, everything works fine.
But then I can't use it as a regular jar library.
Here is my manifest:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Commons Collections Plug-in
Bundle-Category: lib
Bundle-Description: Repackaged Apache Commons Collections
Bundle-SymbolicName: org.apache.commons_collections
Bundle-Version: 3.0.0
Bundle-Localization: plugin
Export-Package: org.apache.commons.collections,
org.apache.commons.collections.bag,
org.apache.commons.collections.bidimap,
org.apache.commons.collections.buffer,
org.apache.commons.collections.collection,
org.apache.commons.collections.comparators,
org.apache.commons.collections.functors,
org.apache.commons.collections.iterators,
org.apache.commons.collections.keyvalue,
org.apache.commons.collections.list,
org.apache.commons.collections.map,
org.apache.commons.collections.set
Bundle-Vendor: Apache Foundation
Eclipse-LazyStart: true
Bundle-ClassPath: .
I've tried lots of different things in the build.properties but nothing
fixes the problem.
Bill
|
|
|
|
|
Re: Struggling with converting lib jar to bundle [message #77625 is a reply to message #77560] |
Sat, 18 November 2006 13:53   |
Eclipse User |
|
|
|
Originally posted by: jeff_mcaffer.REMOVE.ca.ibm.com
Consider using the PDE wizard as detailed at
http://wiki.eclipse.org/index.php/Adding_Bundles_To_Orbit#ad dingLibrary
This should do all the work for you.
Jeff
Bill Kayser wrote:
> I want to convert the apache collections library to a plug-in project
> whose bundle can still be used as a library by non-osgi clients.
>
> I imported the jar file into the new plug-in project so the classpath is
> at the root of the project--the "org" folder is in the root directory.
>
> When I set up the manifest to find classes in the root directory I have
> two problems:
> 1) The IDE does not add the classes to the project classpath.
> 2) The PDE build does not resolve the classes.
>
> However when I export the project as a plug-in and put that in the
> plug-ins directory of the base, the PDE build finds the classes and
> everything compiles okay.
>
> I can solve (1) by adding the root directory to the libraries in the
> java build path of the project.
>
> But (2) has me stumped.
>
> Am I taking the wrong approach? If I just embed the collections jar
> file in the bundle and add it to the classpath, everything works fine.
> But then I can't use it as a regular jar library.
>
> Here is my manifest:
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: Commons Collections Plug-in
> Bundle-Category: lib
> Bundle-Description: Repackaged Apache Commons Collections
> Bundle-SymbolicName: org.apache.commons_collections
> Bundle-Version: 3.0.0
> Bundle-Localization: plugin
> Export-Package: org.apache.commons.collections,
> org.apache.commons.collections.bag,
> org.apache.commons.collections.bidimap,
> org.apache.commons.collections.buffer,
> org.apache.commons.collections.collection,
> org.apache.commons.collections.comparators,
> org.apache.commons.collections.functors,
> org.apache.commons.collections.iterators,
> org.apache.commons.collections.keyvalue,
> org.apache.commons.collections.list,
> org.apache.commons.collections.map,
> org.apache.commons.collections.set
> Bundle-Vendor: Apache Foundation
> Eclipse-LazyStart: true
> Bundle-ClassPath: .
>
> I've tried lots of different things in the build.properties but nothing
> fixes the problem.
>
> Bill
|
|
|
|
Powered by
FUDForum. Page generated in 0.09717 seconds