-2

Maven has several dependency scopes, those however do not feat well with OSGi concept.

  1. OSGi dependencies are non transitive.

OK, it can be specified to exclude all transitive dependencies

  1. OSGi bundle can use some dependency, but do no Export its module. Something like "private dependency"

OK, just use maven provided scope, that is not is not transitive.

  1. OSGi bundle can use some dependency, and export its all or part of its packages. Something like "shared dependency"

Well, that is tricky, as OSGi has more granular package-based Export. Just assume that all packages are Exported, or those not Exported does not matter. But this get messy with Maven optional dependencies 1, 2

Is there a way with Maven start speaking OSGi language and give scopes like

  • private
  • exported / public

Is there just good example of using Maven for non trivial OSGi projects?

Community
  • 1
  • 1
Paul Verest
  • 60,022
  • 51
  • 208
  • 332

1 Answers1

-1

Maven has a plugin which can do everything that you need to create an OSGI bundle. It's maven-bundle-plugin

Maven is a build tool, it's scopes are not same as the scopes of the application that it builds. That said, the scopes that maven provides are for the development and are related to the project only.

Maven bundle plugin is based on the Swiss arm knife of OSGI, BND Tools

If you use eclipse then eclipse already has support for developing OSGI bundles in Eclipse Plugin Development Environment.

11thdimension
  • 10,333
  • 4
  • 33
  • 71