Working with Maven, OSGi and Bndtools

前端 未结 3 1886
一个人的身影
一个人的身影 2021-02-08 14:43

Today I was asked whether it is a good idea to use Maven in our current OSGi application. We used Bndtools and its great since it makes development as easy as possible. Bndtools

相关标签:
3条回答
  • 2021-02-08 15:09

    I think if pretty much anything you do centers around Maven, then Apache Felix Maven plugin (also based on BND, by the way) is the way to go.

    Otherwise if you want to use Maven but in a less central role, Eclipse Tycho makes a lot of sense. Tycho is a set of Maven plugins.

    Using Tycho you supply the target platform from Eclipse to Maven, and then it can resolve all bundles by looking at your MANIFEST and target platform. The pom.xml files are really simple for Tycho projects, as they do not contain your dependencies.

    Tycho is obviously very Eclipse centric. If you don't use eclipse I don't think it makes much sense, but sometimes it is easier to incorporate in an existing project.

    Either way, you can still use the Apache Felix Maven plugin to generate OBR metadata in the deploy phase.

    0 讨论(0)
  • 2021-02-08 15:09

    For those coming to this question now, a lot of time has passed since it was originally asked. The Maven work that Neil Bartlett referred to above has matured and there is quite good integration between Bnd/Bndtools and Maven now, including an m2e connector for Eclipse/Bndtools.

    Neil co-authored a slideshow on this with Tim Ward:

    https://www.slideshare.net/mfrancis/bndtools-and-maven-a-brave-new-world-n-bartlett-t-ward

    0 讨论(0)
  • 2021-02-08 15:17

    I think using Maven with OSGi projects works very well. You can use the Felix Maven BND plugin to make your life a lot easier. With this, maven can automatically generate OBR metadata in your local (or remote) maven repository. This lets you treat your maven repository as an OBR as well. It makes the workflow for OSGi projects the same as other projects, and everything is very seamless and fairly easy to use.

    We use it at work, and Maven really makes things easier to use. For example, we use Maven to generate Eclipse project files, run automated builds on a CI server, and create OBR metadata.

    0 讨论(0)
提交回复
热议问题