Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Handling of extracted nested jar files
Handling of extracted nested jar files [message #506447] Thu, 07 January 2010 14:58 Go to next message
Eclipse UserFriend
Originally posted by: Jens.Borrmann.gillardon.de

Hi,

like many others I have come to the conclusion that it can be a good
idea not to use nested jar files in an OSGi bundle. Now I have some
problems to convince Eclipse to handle this properly.

Let's say I have a library third party library somelibrary.jar with
package somepackage containing a class file SomeClass.class. I need
SomeClass in my own bundle that. I would like to something like the
following structure for my bundle:
src
main
java
mypackage
MyClass.java
classes
somepackage
SomeClass.class
META-INF
Manifest.MF

I do not want to put the packages from somelibrary.jar on the root of my
bundle since this can become quite nasty (Today I saw a jar containing a
top level package called temp...).

In build.properties I edited source..
source.. = src/main/java/,src/main/classes/

If I use the export wizard for exporting the plugin as a jar file
everything works well and somepackage can be found at the root of the
newly created jar file.

The only problem with my approach is that the manifest wizard for my
bundle does not "know" somepackage. If I try to add an Exported Package
on the Runtime tab I am only offered mypackage and not somepackage.
Editing MANIFEST.MF manually is possible. So is importing a manually
created export from another bundle.

So I suppose that I am missing a basic trick that would help the PDE
tools to help me. Any suggestions?

--- Jens
Re: Handling of extracted nested jar files [message #506588 is a reply to message #506447] Fri, 08 January 2010 08:21 Go to previous message
ekkehard gentz is currently offline ekkehard gentzFriend
Messages: 118
Registered: July 2009
Location: rosenheim, Germany, bavar...
Senior Member

This is a multi-part message in MIME format.
--------------030509080700060402040808
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Jens,

if you're using a 3rdParty Library then the best way is to create a
wrapper bundle
only including the classes from 3rd bundle at the root
and exporting these classes

then in your own bundle you can import them

this way its also easy to use a newer version of the 3rdparty jar
or perhaps you can ask the developer of 3rdParty to add OSGI
informations to the MANIFEST
and later use this jar directly inbstead your wraper bundle

ekke
Am 07.01.10 15:58, schrieb Jens Borrmann:
> Hi,
>
> like many others I have come to the conclusion that it can be a good
> idea not to use nested jar files in an OSGi bundle. Now I have some
> problems to convince Eclipse to handle this properly.
>
> Let's say I have a library third party library somelibrary.jar with
> package somepackage containing a class file SomeClass.class. I need
> SomeClass in my own bundle that. I would like to something like the
> following structure for my bundle:
> src
> main
> java
> mypackage
> MyClass.java
> classes
> somepackage
> SomeClass.class
> META-INF
> Manifest.MF
>
> I do not want to put the packages from somelibrary.jar on the root of
> my bundle since this can become quite nasty (Today I saw a jar
> containing a top level package called temp...).
>
> In build.properties I edited source..
> source.. = src/main/java/,src/main/classes/
>
> If I use the export wizard for exporting the plugin as a jar file
> everything works well and somepackage can be found at the root of the
> newly created jar file.
>
> The only problem with my approach is that the manifest wizard for my
> bundle does not "know" somepackage. If I try to add an Exported
> Package on the Runtime tab I am only offered mypackage and not
> somepackage. Editing MANIFEST.MF manually is possible. So is importing
> a manually created export from another bundle.
>
> So I suppose that I am missing a basic trick that would help the PDE
> tools to help me. Any suggestions?
>
> --- Jens


--

ekke (ekkehard gentz)
independent software-architect
senior erp-consultant
eclipse | osgi | equinox | mdsd | oaw | emf | uml
max-josefs-platz 30, D-83022 rosenheim, germany
mailto:ekke@ekkes-corner.org
homepage (de): http://gentz-software.de
blog (en): http://ekkes-corner.org
twitter: @ekkescorner
skype: ekkes-corner
Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID: DE189929490


--------------030509080700060402040808
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Jens,<br>
<br>
if you're using a 3rdParty Library then the best way is to create a
wrapper bundle<br>
only including the classes from 3rd bundle at the root<br>
and exporting these classes<br>
<br>
then in your own bundle you can import them<br>
<br>
this way its also easy to use a newer version of the 3rdparty jar<br>
or perhaps you can ask the developer of 3rdParty to add OSGI
informations to the MANIFEST<br>
and later use this jar directly inbstead your wraper bundle<br>
<br>
ekke<br>
Am 07.01.10 15:58, schrieb Jens Borrmann:
<blockquote cite="mid:hi4sq7$g8h$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
like many others I have come to the conclusion that it can be a good
idea not to use nested jar files in an OSGi bundle. Now I have some
problems to convince Eclipse to handle this properly.
<br>
<br>
Let's say I have a library third party library somelibrary.jar with
package somepackage containing a class file SomeClass.class. I need
SomeClass in my own bundle that. I would like to something like the
following structure for my bundle:
<br>
src
<br>


ekke
independent software architect

blog: http://ekkes-corner.org
twitter: @ekkescorner
Re: Handling of extracted nested jar files [message #604025 is a reply to message #506447] Fri, 08 January 2010 08:21 Go to previous message
ekkehard gentz is currently offline ekkehard gentzFriend
Messages: 118
Registered: July 2009
Location: rosenheim, Germany, bavar...
Senior Member

This is a multi-part message in MIME format.
--------------030509080700060402040808
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Jens,

if you're using a 3rdParty Library then the best way is to create a
wrapper bundle
only including the classes from 3rd bundle at the root
and exporting these classes

then in your own bundle you can import them

this way its also easy to use a newer version of the 3rdparty jar
or perhaps you can ask the developer of 3rdParty to add OSGI
informations to the MANIFEST
and later use this jar directly inbstead your wraper bundle

ekke
Am 07.01.10 15:58, schrieb Jens Borrmann:
> Hi,
>
> like many others I have come to the conclusion that it can be a good
> idea not to use nested jar files in an OSGi bundle. Now I have some
> problems to convince Eclipse to handle this properly.
>
> Let's say I have a library third party library somelibrary.jar with
> package somepackage containing a class file SomeClass.class. I need
> SomeClass in my own bundle that. I would like to something like the
> following structure for my bundle:
> src
> main
> java
> mypackage
> MyClass.java
> classes
> somepackage
> SomeClass.class
> META-INF
> Manifest.MF
>
> I do not want to put the packages from somelibrary.jar on the root of
> my bundle since this can become quite nasty (Today I saw a jar
> containing a top level package called temp...).
>
> In build.properties I edited source..
> source.. = src/main/java/,src/main/classes/
>
> If I use the export wizard for exporting the plugin as a jar file
> everything works well and somepackage can be found at the root of the
> newly created jar file.
>
> The only problem with my approach is that the manifest wizard for my
> bundle does not "know" somepackage. If I try to add an Exported
> Package on the Runtime tab I am only offered mypackage and not
> somepackage. Editing MANIFEST.MF manually is possible. So is importing
> a manually created export from another bundle.
>
> So I suppose that I am missing a basic trick that would help the PDE
> tools to help me. Any suggestions?
>
> --- Jens


--

ekke (ekkehard gentz)
independent software-architect
senior erp-consultant
eclipse | osgi | equinox | mdsd | oaw | emf | uml
max-josefs-platz 30, D-83022 rosenheim, germany
mailto:ekke@ekkes-corner.org
homepage (de): http://gentz-software.de
blog (en): http://ekkes-corner.org
twitter: @ekkescorner
skype: ekkes-corner
Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID: DE189929490


--------------030509080700060402040808
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Jens,<br>
<br>
if you're using a 3rdParty Library then the best way is to create a
wrapper bundle<br>
only including the classes from 3rd bundle at the root<br>
and exporting these classes<br>
<br>
then in your own bundle you can import them<br>
<br>
this way its also easy to use a newer version of the 3rdparty jar<br>
or perhaps you can ask the developer of 3rdParty to add OSGI
informations to the MANIFEST<br>
and later use this jar directly inbstead your wraper bundle<br>
<br>
ekke<br>
Am 07.01.10 15:58, schrieb Jens Borrmann:
<blockquote cite="mid:hi4sq7$g8h$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
like many others I have come to the conclusion that it can be a good
idea not to use nested jar files in an OSGi bundle. Now I have some
problems to convince Eclipse to handle this properly.
<br>
<br>
Let's say I have a library third party library somelibrary.jar with
package somepackage containing a class file SomeClass.class. I need
SomeClass in my own bundle that. I would like to something like the
following structure for my bundle:
<br>
src
<br>


ekke
independent software architect

blog: http://ekkes-corner.org
twitter: @ekkescorner
Previous Topic:Handling of extracted nested jar files
Next Topic:Troubles with PDE build and target platform
Goto Forum:
  


Current Time: Sat Nov 29 10:08:09 GMT 2014

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

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