Hello all,

Thank's a lot for your answers.
In the beginning I was even more confused by your answers but then...
What I did not understand was the packaging issue, because when I executed for 
example
The hibernate osgi pom with or without excluding hibernate's transitive 
dependencies -
I always got the same resulting jar file - the dependencies never got added to 
the
Jar, only 'declarative' in the MANIFEST file.
So that's why I did not understand why to exclude the dependencies.
But then I remembered that I changed the felix maven bundle plugin 
(BundlePlugin.java) as I have a problem
With its regular expression handling with maven SNAPSHOT versions when bundling 
my own osgi projects.
(I still have this problem, although I was building it from the felix trunk, 
version 0.9.0-incubator-SNAPSHOT).
As you all probably know Carlos Sanchez developed a maven-bundle-plugin with 
some additional goals but also the
bundle goal. 
So I replaced the felix BundlePlugin class with the one of Carlos. This fixed 
the version handling, but apparently
Changed something else as well - when bundling with this plugin the transitive 
dependencies are not added to the resulting bundle jar.
After remembering this, I then tried again with the 'original' felix maven 
bundle plugin and voila the dependencies(exploded packages) were added to the 
osgi jar file and then I understood the excluding issue.
I don't know now if this was an intended feature that Carlos added - but if - 
it looks like you don't have to exclude
Anymore.
But anyway your answers helped a lot because I still have problems with 
changing between Maven and OSGi world and how they could work together the best 
way.

So, thanx again,

Michael 

 
 

-----Ursprüngliche Nachricht-----
Von: Stuart McCulloch [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 09. März 2007 09:17
An: felix-dev@incubator.apache.org
Betreff: Re: maven-bundle-plugin, wrapping and excludeTransitive

Hi Michael,

If the original jar has dependencies with 'compile' scope then they're added to
the build classpath and packaged in the final bundle. This may or may not be
what you want - some jars have dependencies that form a collective module
and would never appear separately, so you'd like those dependencies added.

Other jars have dependencies that could be shared among a lot of bundles
(ie. jdbc) - in that case you'd make a separate bundle of the dependency and
would not want it added to the parent jar (to avoid classpath issues & bloat).

If you decide to not include a dependency inside a bundle, you should probably
declare the import as optional using ";resolution:=optional".

Cheers, Stuart

On 09/03/07, Hampel, Michael <[EMAIL PROTECTED]> wrote:
>
> Hello Alin,
>
> I don't understand why you would have to exclude the dependencies - as far as 
> I
> Understood the maven-bundle plugin is not doing anything with the maven 
> dependencies.
> If the dependencies are excluded (like in the hibernate osgi pom) and I add 
> the hibernate
> Osgi jar as a dependency to my project, I would loose the transitive 
> capability of maven as the
> Transitive dependencies of hibernate are not added anymore, e.g.: when doing 
> eclipse:eclipse.
> On the other side it makes sense to exclude the dependencies, because I also 
> will have to wrap the
> Hibernate dependencies to become osgi bundles - so the jta dependencies will 
> change to a jta-osgi dependency....
> Does this mean I have to forget about maven's transitive capabilites?
>
> Maybe I am thinking completely wrong here - but probably you could shed some 
> light,
>
> Thanx,
>
> Michael
>
>
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Alin Dreghiciu [mailto:[EMAIL PROTECTED]
> Gesendet: Donnerstag, 08. März 2007 14:18
> An: felix-dev@incubator.apache.org
> Betreff: maven-bundle-plugin, wrapping and excludeTransitive
>
> About jar wrapping:
>
> Most of the time (at least in the cases I had) you would like to wrap only
> the content of the jar you are targeting and not also the transitive
> dependencies that the targeted jar has. You can do this in at least two
> ways:
> 1. add <exclusions> to the dependency. This is verbose for the case that the
> targeted jar has extensive dependencies and irrelevant to the process of
> wrapping
> 2. set the Export-package directive  to export only those packages that you
> want. here you have to know the internals of the package and if the jar has
> some resources as licences, xmls' outside the main package you have to add
> them one by one.
>
> So, here I am proposing a new configuration option: excludeTransitive that
> is suppose to exclude the transitive artifacts if set to true.
>
> An example implementation can be found at the following location:
> http://maven.apache.org/plugins/maven-dependency-plugin/xref/org/apache/maven/plugin/dependency/utils/filters/TransitivityFilter.html
>
> Alin Dreghiciu
>
> PS. Maven does not support a property of the articat as isTransitive()
>
> <http://maven.apache.org/plugins/maven-dependency-plugin/xref/org/apache/maven/plugin/dependency/utils/filters/TransitivityFilter.html>
>

Reply via email to