I am moving my spring-java project to osgi.
I have some dependencies which are not available as bundles in the spring ebr repo or in maven repo.
What are the best ways to handle them?
The options I can think of are
- create a local maven repo, convert the jars to bundles and use them ( this will become difficult with the transitive dependencies and updates of the jar)
- add them in the bundle classpath ( my bundle becomes huge and managing those jars is not easy with upgrades)
- keep all such jars in the classpath of another bundle, export the packages and use them ( again managing the jars is difficult)
Any other suggestions or which of the above is advisable?
The most advisable way is your first option, because that is the ‘OSGi way’. This way you can better modularise your application and share the same bundle in different client bundles. You can also benefit from the version management inherent in OSGi.
You don’t necessarily have to use Maven to create bundles from the JARs, although that may help. You can also use bnd to wrap a JAR as an OSGi bundle.