Skip to content
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

Merged
merged 1 commit into from Apr 5, 2012
Merged

Add OSGi bundle manifest headers #213

merged 1 commit into from Apr 5, 2012

Conversation

oconnor0
Copy link
Contributor

@oconnor0 oconnor0 commented Apr 5, 2012

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.)

codahale added a commit that referenced this pull request Apr 5, 2012
Add OSGi bundle manifest headers
@codahale codahale merged commit 9630727 into dropwizard:master Apr 5, 2012
@mattbishop
Copy link

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).

        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <extensions>true</extensions>
        </plugin>

@codahale
Copy link
Contributor

@mattbishop, I'll take a pull request, but given that I don't use OSGi it's not a priority of mine.

@mattbishop
Copy link

That's probably best as I can verify that it works in felix. Thanks!

@mattbishop
Copy link

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?

@codahale
Copy link
Contributor

Did it get applied to master?

@mattbishop
Copy link

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.

@codahale
Copy link
Contributor

Ok, so this is good for 3.0.0, which should be out soon.

@mattbishop
Copy link

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!

@codahale
Copy link
Contributor

Probably a week or two.

If it's a big deal, I can push a point release.

@mattbishop
Copy link

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:

Probably a week or two.

If it's a big deal, I can push a point release.


Reply to this email directly or view it on GitHub.

@toelen
Copy link

toelen commented Nov 13, 2012

+1 for a point release

@codahale
Copy link
Contributor

2.1.4-SNAPSHOT should be available. Please let me know if it works for you.

@mattbishop
Copy link

I have verified that 2.1.4-SNAPSHOT has the headers and functions as expected in my OSGi application.

THanks!

@codahale
Copy link
Contributor

2.1.4 is on its way to Central.

@codahale
Copy link
Contributor

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.

@mattbishop
Copy link

Have a look at oconnor's original pull request commit:

codahale/metrics@9d151f6

Now, I don't know if that will keep Maven Enforcer happy or not but OSGi is OK with using the bundle fragment approach.

@codahale
Copy link
Contributor

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.

@mattbishop
Copy link

I agree, that is the best solution. OSGi fragments are meant more for configuring things like database drivers and such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants