karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject [karaf-boot] New plugin system POC
Date Thu, 12 May 2016 07:18:15 GMT
We currently use java annotation processors for out starters. The 
problem is that these are not integrated with maven.
So for example if we create files in the processors they will not be 
added to the resulting jar.

I have created a prototype of a new plugin system based on xbean finder 
and a karaf boot plugin SPI in a new branch.


The karaf-boot maven plugin uses xbean finder to scan for boot-plugins. 
Each boot plugin can then define which trigger annotation it supports 
and will be called
back with all classes in user code that are annotated with the 
respective annotation. The plugin can then process the information and
create files as well as define additional Manifest headers.

Maven plugin

Boot-plugin spi

The JPA starter is currently the only starter that uses the SPI

The JPA sample shows how it works. I did not need to do any changes to 
the example

A good thing in the new SPI is that the user code only depends on the 
plugin API it does not need access to xbean finder. I think this 
approach could allow us to keep the user space quite
free of our internal dependencies if we do it well.

I talked to Guillaume about the new plugin mechanism. He would prefer to 
use a bnd plugin for this. I am open to this but was not able to 
implement it
in short term. The bnd API is a bit strange. Still bnd should also 
provide us with all the features we need.

The current code combines the headers of all plugins into a bnd file 
which is then given to the maven-bundle-plugin. One thing that does not 
yet work is to
also allow the user to override some settings in his own bnd file. bnd 
does not seem to allow one such file override settings defined in another.
I would be glad about any ideas how to make this work.


Christian Schneider

Open Source Architect

View raw message