micrometer
micrometer copied to clipboard
Add BND plugin and OSGi export core package.
This change enables the generation of OSGi metadata for all JARs (so turns them into OSGi bundles). A couple of notes:
exportcontents: io.micrometer.*is a bit "brute force". Ideally, we would only export the packages that are considered "API" and people will consume in their applications. However, I'm not familiar enough with the Micrometer structure to judge whether this should be more fine-grained or if this "export all packages" approach is ok.- OSGi will resolve all dependencies listed in the
Import-Packagessection in the manifest, unless they are explicitly marked as optional. - Because a jar has OSGi metadata does not necessarily mean it's usable in an OSGi framework as all the transitive dependencies need to have this metadata too.
- I have tested this change in our local OSGi application using the Prometheus registry only. I suspect not all registries will work in an OSGi environment because of the above comment. This is something that would need to be resolved in the downstream code, however.
I believe this PR would also resolve this issue: https://github.com/micrometer-metrics/micrometer/issues/3149
@driessamyn Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
:warning: 10 God Classes were detected by Lift in this project. Visit the Lift web console for more details.
@driessamyn Could you rebase on the latest main? I was trying to do that and see if I could get the build to pass, but I was having trouble getting the task testOSGi to pass after rebasing.
@driessamyn Could you rebase on the latest
main? I was trying to do that and see if I could get the build to pass, but I was having trouble getting the tasktestOSGito pass after rebasing.
@shakuzen I rebased with the main branch and resolve the gradle file conflicts.
I validated the testOSGi target (./gradlew :micrometer-osgi-test:testOSGi).
Let me know if there is anything else you need.
@driessamyn Thank you for signing the Contributor License Agreement!