...
- For jars that are intended to be usable by other projects, build them with the maven-bundle-plugin so they include OSGi metadata.
- Put APIs and implementation details in different packages. A Two common convention conventions in the OSGi world is are to use the an ".internal" or ".impl" suffix on packages that contain implementation details. If you use the maven-bundle-plugin, such named packages will not be exported by default.
- If possible, avoid using libraries that are known to be problematic in OSGi environments, or require third-party repackaging in order to work in OSGi environments. Well-known examples include:
- commons-logging (no longer a problem for Fedora: see FCREPO-630)
- jersey (see FCREPO-540)
...