New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OSGi bundle manifest headers #213
Conversation
Add OSGi bundle manifest headers
This needs to be reopened as it is incomplete. The POMs need to have the maven-bundle-plugin turned on, much like the jar plugin. Setting the project packaging to 'bundle' is only half the change. For every POM that has bundle set to project packaging bundle, the following snippet needs to be added as well (except for the ones for ganglia and graphite, they are fine as fragments).
|
@mattbishop, I'll take a pull request, but given that I don't use OSGi it's not a priority of mine. |
That's probably best as I can verify that it works in felix. Thanks! |
It looks like the pull request from 7 months ago did not make it into 2.1.3. (See https://github.com/codahale/metrics/blob/v2.1.3/pom.xml). Any idea why that would be? |
Did it get applied to master? |
It appears so. From the history above: codahale merged commit 9630727 into codahale:master from oconnor0:master 7 months ago And then if you look at https://github.com/codahale/metrics/blob/master/pom.xml you will see the maven-bundle-plugin configured. |
Ok, so this is good for 3.0.0, which should be out soon. |
Can you give me a rough idea about 3.0's timeline? Are you thinking days, weeks, months? I need to decide what to do with a story around metrics in our product and if the timeline is good I can wait, otherwise I have to go another direction. Thanks! |
Probably a week or two. If it's a big deal, I can push a point release. |
A point release would be good to validate the build gets these headers in actually. Thanks! Matt Bishop On 2012-11-10, at 1:45 PM, Coda Hale notifications@github.com wrote:
|
+1 for a point release |
2.1.4-SNAPSHOT should be available. Please let me know if it works for you. |
I have verified that 2.1.4-SNAPSHOT has the headers and functions as expected in my OSGi application. THanks! |
2.1.4 is on its way to Central. |
So, it turns out that OSGi bundles the entire package, which means duplicate versions of everything in metrics-core:com.yammer.metrics.reporting in metrics-ganglia, metrics-graphite, and metrics-servlet. I've backed out the OSGi support in 2.2.0-SNAPSHOT. You'll have to wait for 3.0 for full OSGi support. |
Have a look at oconnor's original pull request commit: Now, I don't know if that will keep Maven Enforcer happy or not but OSGi is OK with using the bundle fragment approach. |
I have looked at that. In fact, that's what I shipped in 2.1.4. It will not keep Maven Enforcer happy. I know that OSGi is OK with it, but shipping multiple copies of classes is bad for everyone else (including me). This will have to wait until 3.0, because the only solution which works for everyone is to not split packages across modules. |
I agree, that is the best solution. OSGi fragments are meant more for configuring things like database drivers and such. |
Add maven-bundle-plugin (with all defaults) to parent pom.xml
Change packaging type to bundle.
Set Fragment-Host on metrics-ganglia, metrics-graphite, & metrics-servlet as they expose the same package (com.yammer.metrics.reporting) as metrics-core does.
If it is undesirable to change the packaging to bundle, I can provide a more involved change to the poms. (Using maven-bundle-plugin to generate the MANIFEST.MF & using maven-jar-plugin to include it in the product.)