Java – using maven, OSGi, and bndtools
Today, I was asked that using Maven in our current OSGi application is a good idea We use bndtools and it's great because it makes development as easy as possible Bndtools uses OBR to maintain the resolution of other bundles and dependencies, even when the application is running
Because Maven is widely spread and very popular, most people try to use it in OSGi environment For me, there are two different ways OSGi has its own dependency declaration, manifest MF and Maven a POM in which you can declare them So if you use these two, you will declare the dependency twice Of course, you can avoid it by using the Apache OSGi Maven plug-in, which is responsible for creating manifest MF. But the Maven repository doesn't care about bundles So it may happen that you are referring to an unbound jar
Of course, using Maven has advantages, but is it really a good thing to combine it with OSGi or special bndtools?
Someone can offer advantages or disadvantages! Does anyone have practical experience using both?
Solution
I think if everything you do revolves around maven, the Apache Felix Maven plug-in (that is, Bnd based) is the way to go
Otherwise, eclipse Tycho makes a lot of sense if you want to use Maven but less important roles Tycho is a set of Maven plug - ins
With Tycho, you can provide the target platform from eclipse to maven, and then you can solve all software packages by viewing your manifest and target platform For Tycho project, POM XML files are very simple because they do not contain your dependencies
Tycho is obviously eclipse - centric If you don't use eclipse, I don't think it makes sense, but sometimes it's easier to add it to an existing project
Either way, you can still use the Apache Felix Maven plug-in to generate OBR metadata at the deployment stage