felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Sanchez" <car...@apache.org>
Subject Re: Improving integration between maven and osgi
Date Wed, 31 Jan 2007 20:13:20 GMT
On 1/31/07, Richard S. Hall <heavy@ungoverned.org> wrote:
> 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.

the reason i heard to discourage require-bundle was that only specific
packages of a bundle may be needed. Maven encourages splitting big
projects into reusable components so you usually end with few packages
in each bundle, being pretty close to the import-packages is.

>    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.

the point is to compliment both by easily generating OSGi bundles from
any Maven project.

> 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.

afaik the current status of the bundle plugin doesn't read pom
dependencies to generate the import-packages but the imports in the
classes. The only thing used from the pom if not explicitly configured
is the Maven generated classpath, am I wrong?

> -> richard

I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

View raw message