Whether or not this is the preferred method depends upon how the
contents of these third-party JARs are used. If they are used within
the context of a single bundle, then it would be better IMHO to embed
them without exporting them, i.e. by using <Embed-Dependency>.

For example, take a look at
http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/scheduler/pom.xml
which builds a bundle which embeds Quartz.

Even when exporting third-party packages, I would still recommend the
use of <Embed-Dependency> as it makes your intentions clearer. Also,
AFAIK, <Embed-Transitive> applies to <Embed-Dependency>, not anything
embedded automatically because of an export.

Justin

On Wed, Sep 8, 2010 at 9:54 AM,  <[email protected]> wrote:
>
>
> All,
>
>
>
> The application we are porting over to OSGi has a number of third party .jar 
> files that for various reasons we are not able to get bundled versions.  It 
> sounded like the preferred OSGi method to solve this is to place the needed 
> packages in the <Export-Package> directive in the maven_bundle_plugin, which 
> would result in those specific packages being unpacked, placed directly into 
> the bundle being created, and added to the MANIFEST.MF file.
>
>
>
> The only hitch to this is when your third party .jar has a transitive 
> dependency, a dependency of a dependency.  However, there are a few cases 
> where there are dependencies of the transitive dependencies also.  In these 
> cases, adding these dependent packages to the <Export_Packages> 
> section results in a superfluous packages warning, and the exported packages 
> are not included in the resulting bundle.  Upon deployment, a constraint 
> violation occurs, identifying these exported packages.  I also tried simply 
> importing the packages with a "resolution:=optional" direction, but that also 
> did not work.
>
>
>
> I thought that <Embed-Transitives>true</Embed-Transitives> was supposed to 
> override the superfluous packages warning in the Maven-Bundle-Plugin so that 
> all exported packages would be included in the resulting bundle.  This does 
> not appear to be the case.  So, my questions are:
>
> 1) What does the Embed-Transitives directive actually do, and
>
> 2) How can I override the Superfluous Packages warning so my bundle will have 
> all the packages it needs for deployment?
>
>
>
> Creating bundles out of the offending packages is also not an option due to 
> system security constraints.  And before we even go down that road, remember, 
> we're in a hyper-secure world where all big companies do things (even some 
> dumb things) to maintain security.
>
>
>
> v/r,
>
>
>
> Mike Van
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to