Carlos Sanchez wrote:
Hi all,
I'm trying to make maven generate OSGi bundles based in the information
of the pom as much as possible. That implies generating "Require-bundle"
headers based on the dependencies section of the pom instead of
autodiscovered "Import-packages".
I'd take groupId.artifactId as bundle name and dependency version as
bundle version.
In the future this could be the standard for any jar generated by Maven.
It will assume that dependencies are already available as OSGi bundles,
although I'm working on a recursive mode that will generate
one bundle for each dependency scanning the whole tree of transitive
dependencies.
Please let me know if this sounds right for the maven-bundle-plugin.
Any comments appreciated ;)
I'm of two minds on this...
1. I think that use of require-bundle should be discouraged as a
general mechanism, since it creates brittle systems and has odd
side effects.
2. I admit that if we want to support require-bundle at all,
maven-bundle-plugin is probably the place to put it.
In general, I do not have a goal to get OSGi bundle developers
integrating more tightly with Maven, since Maven's dependency model is
not as sophisticated as OSGi's. I prefer to find ways to make it easier
to follow OSGi best practices, than Maven best practices.
Ultimately, except for split packages, you can mimic require-bundle
fairly nicely with the existing plugin by exporting all project packages
and importing everything else, which is essentially what Peter was
trying to work with Jason van Zyl on previously. This can be done to
achieve a similar level of integration with Maven as proposed without
any additional information other than what is in the pom too. So,
explicit support for require-bundle may not really be necessary.
-> richard