This page has been
moved to the new
HttpComponents Wiki.
#pragma section-numbers off
OSGi-Enabling HttpComponents
OSGi bundles are JARs with additional metadata that allows for easy deployment of the bundles in OSGi frameworks, such as Apache Felix or Eclipse Equinox. Since the difference is only the metadata, I (Roland Weber) will look into generating OSGi bundles instead of plain JARs for the HttpComponents. I'll record my ideas and progress on this page, hoping to eventually turn that into documentation useful for others.
Tools
The tool of choice for a Maven 2 based project at Apache is the
maven-bundle-plugin maintained by the Apache Felix team. That plugin creates complete OSGi bundles, not just the additional metadata. As such, it would have to replace the currently used maven-jar-plugin for our release builds. The maven-jar-plugin is specified in the component's parent POM, applicable for all modules in all components.
Plan
Start with HttpCore-main, as it has no dependencies beyond plain Java. Put the maven-bundle-plugin into the module POM, and check the output carefully:
Are all classes in the bundle?
Are all non-classes (properties files) in the bundle?
Is the metadata for the bundle correct? (version, symbolic name, package lists)
Compare the effort for the maven-bundle-plugin with the (non-)effort for the maven-jar-plugin. The bundle plugin calls a separate tool and is therefore not as tightly integrated with Maven 2.
If the approach is feasible, move on to !HttpNIO and !HttpNIOSSL. Consider moving the maven-bundle-plugin definition to the component POM. Switch the release assembly from the plain JAR to the OSGi bundle.
If the approach is not feasible, consider working with the Felix team to improve the plugin integration.
Status
Read through the maven-bundle-plugin documentation. No hands-on experiments yet.
Progress
not yet started