Question

I'm new to osgi and really confused about how it all fits together. I want to create 3 bundles, an api bundle that defines an interface, a impl bundle that provides an implementation and another bundle that uses the implemenation using maven and the maven-bundle-pugin.

I need a bit of guidance:

  1. do i need 3 maven projects?

  2. does it help to/should i use a maven archetype for creating the projects?

  3. do i need tu use maven-pax?

  4. any other hints for a osgi newbie?

Thank you

Was it helpful?

Solution

I have written a tutorial some time ago that may contain what you need. Some spoilers ..

  • Yes you should create three maven projects. Ideally also a parent project so you can build them in one command.

  • You can use an archetype but the easier way may be to just copy the example code and change it.

  • The tutorial shows how to deploy on Apache Karaf which imho is the easiest OSGi server to start with. Still the bundles produces during the build should also work in plain Felix or Equinox but the deployment will be a little harder.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top