On 14.09.2015 11:37, Neil Bartlett wrote:
>
> Bndtools does not support either Karaf features or Eclipse features.
> I’m not sure what we would use these for.
>
> We may in the future support p2 repositories as an alternative index
> type, and this might help interop with PDE. I don’t think this is
> directly related to Maven however. Personally I don’t plan to spend
> any time on p2 integration unless a customer sponsors the development
> of it.
>
The features allow to add functionality in a coarse grained way. In
karaf this is crucial as we do not have an index and a real resolver. So
without features it would be just too much work to add all needed
bundles. Karaf 4 now works with a resolver internally so that might
shift a bit in the future.
Still I think features are necessary sometimes. For example if you have
a very loosely coupled architecture then the resolver can not always
help you to choose a good set of bundles. With an index the karaf
features could be changed. So instead of containing all detailed bundles
they would just contain requirements like the -runrequires in bndtools.
Bndtools could then allow to add features as requirements so people do
not have to add all of that themselves.
So for example if your user bundle just depends on the persistence api
and the transaction api then the resolver can not help much to install
Aries JPA and for example hibernate. What is your strategy in bndtools
to solve this without features?
>> I think it is unrealistic for maven central to have one complete OSGi
>> metadata index. It would be too large and probably even contain a lot
>> of problematic or contradicting information.
>
> Yes absolutely. Even your ~/.m2/repository directory is very
> uncontrolled and likely to produce unpredictable resolution results.
>
> Our plan at the moment — and Tim Ward has been working on this — is to
> deliver a separate Maven plugin called the bnd-indexer-maven-plugin.
> This works a bit like the assembly plugin, except that instead of
> spitting out an EAR or WAR file it produces an OSGi index of its
> (transitive) dependencies. So you would create an index module in your
> top-level project that lists dependencies on your own modules, and it
> hopefully indexes everything required including third-party
> dependencies from Maven Central or your Nexus/Artifactory repo.
>
> Unfortunately the dependencies in third party POMs are often poor
> quality, so the transitive dependency set will likely miss some
> things. In these cases you would have to add them as explicit
> dependencies to your index module. On the other hand, it doesn’t
> really matter if you overshoot and index too many dependencies,
> because the Bndtools resolver will still resolve only the minimal set
> for your top-level dependencies.
I really like the idea to be able to create a custom index from a maven
pom. I also had that in mind.
Additionally we should push these indexes to the maven repo during the
build. So for example Aries can create indexes for their subprojects
that make it then really easy for people to use them in bndtools.
>> Would it be possible to instead create indexes for subsets of
>> bundles. Like Aries could create one index for each subproject per
>> version. This index could be generated from a list of bundles that
>> will also be used during the testing. Does that make sense?
>
> Yes. The missing pieces in this tool chain at the moment are the
> ability to take a bndrun file and: (1) integration test it, and (2)
> assemble a deployable & executable artifact such as an uber-jar.
If the maven plugin you mentioned creates the index wouldnt bndrun then
be able to do the rest? As far as I know integration tests and the
assembly already work for classic bndtools indexes.
Christian