Skip to content

Adds bnd maven plugin to gen osgi manifest for issue #2074#2075

Closed
scottslewis wants to merge 4 commits intosmallrye:mainfrom
scottslewis:issue_2074
Closed

Adds bnd maven plugin to gen osgi manifest for issue #2074#2075
scottslewis wants to merge 4 commits intosmallrye:mainfrom
scottslewis:issue_2074

Conversation

@scottslewis
Copy link
Copy Markdown
Contributor

Added bnd maven plugin manifest generation for implementation sub-module.

Starting with the implementation. Once we have this in good shape I'll contribute prs for any other desired jars that are part of mutiny.

Here is the generated manifest.mf for my local test build:

Manifest-Version: 1.0
Created-By: 22.0.2 (Oracle Corporation)
Build-Jdk-Spec: 22
Specification-Title: SmallRye Mutiny - Core library
Specification-Version: 999.0
Specification-Vendor: SmallRye
Implementation-Title: SmallRye Mutiny - Core library
Implementation-Version: 999-SNAPSHOT
Implementation-Vendor: SmallRye
Implementation-URL: https://smallrye.io/smallrye-mutiny
Java-Version: 22.0.2
Scm-Connection: scm:git:git@github.com:smallrye/smallrye-mutiny.git/muti
 ny
Scm-Revision: 1d90a534900d29d5cb324f6a5cc6fd0bcbbffb50
Scm-Url: https://github.com/smallrye/smallrye-mutiny/mutiny
Automatic-Module-Name: io.smallrye.reactive.mutiny
Bnd-LastModified: 1771711080722
Bundle-Description: Intuitive Event-Driven Reactive Programming Library 
 for Java
Bundle-Developers: cescoffier;email="clement[AT]apache[DOT]org";name="Cl
 ement Escoffier",jponge;email="julien[AT]ponge[DOT]org";name="Julien Po
 nge"
Bundle-DocURL: https://smallrye.io/smallrye-mutiny
Bundle-License: "Apache License, Version 2.0";link="https://www.apache.o
 rg/licenses/LICENSE-2.0.txt";description="A business-friendly OSS licen
 se"
Bundle-ManifestVersion: 2
Bundle-Name: Bundle io.smallrye.reactive : mutiny
Bundle-SCM: url="https://github.com/smallrye/smallrye-mutiny/mutiny",con
 nection="scm:git:git@github.com:smallrye/smallrye-mutiny.git/mutiny",de
 veloper-connection="scm:git:git@github.com:smallrye/smallrye-mutiny.git
 /mutiny",tag=HEAD
Bundle-SymbolicName: io.smallrye.reactive.mutiny
Bundle-Vendor: SmallRye
Bundle-Version: 999.0.0.SNAPSHOT
Export-Package: io.smallrye.mutiny;version="999.0.0.SNAPSHOT",io.smallry
 e.mutiny.converters;version="999.0.0.SNAPSHOT",io.smallrye.mutiny.conve
 rters.multi;version="999.0.0.SNAPSHOT",io.smallrye.mutiny.converters.un
 i;version="999.0.0.SNAPSHOT",io.smallrye.mutiny.groups;version="999.0.0
 .SNAPSHOT",io.smallrye.mutiny.helpers;version="999.0.0.SNAPSHOT",io.sma
 llrye.mutiny.helpers.queues;version="999.0.0.SNAPSHOT",io.smallrye.muti
 ny.helpers.spies;version="999.0.0.SNAPSHOT",io.smallrye.mutiny.helpers.
 test;version="999.0.0.SNAPSHOT",io.smallrye.mutiny.infrastructure;versi
 on="999.0.0.SNAPSHOT",io.smallrye.mutiny.operators;version="999.0.0.SNA
 PSHOT",io.smallrye.mutiny.operators.multi;version="999.0.0.SNAPSHOT",io
 .smallrye.mutiny.operators.multi.builders;version="999.0.0.SNAPSHOT",io
 .smallrye.mutiny.operators.multi.multicast;version="999.0.0.SNAPSHOT",i
 o.smallrye.mutiny.operators.multi.overflow;version="999.0.0.SNAPSHOT",i
 o.smallrye.mutiny.operators.multi.processors;version="999.0.0.SNAPSHOT"
 ,io.smallrye.mutiny.operators.multi.replay;version="999.0.0.SNAPSHOT",i
 o.smallrye.mutiny.operators.multi.split;version="999.0.0.SNAPSHOT",io.s
 mallrye.mutiny.operators.uni;version="999.0.0.SNAPSHOT",io.smallrye.mut
 iny.operators.uni.builders;version="999.0.0.SNAPSHOT",io.smallrye.mutin
 y.subscription;version="999.0.0.SNAPSHOT",io.smallrye.mutiny.tuples;ver
 sion="999.0.0.SNAPSHOT",io.smallrye.mutiny.unchecked;version="999.0.0.S
 NAPSHOT"
Import-Package: org.jctools.queues.atomic.unpadded;resolution:=required;
 version="[4.0,5)",io.smallrye.common.annotation
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=17))"
Tool: Bnd-7.1.0.202411251545

Things to look at/discuss among smallrye team:

This version in pom.xml is almost certainly not right, but don't know how your build works. 999-SNAPSHOT

Bundle-SymbolicName: io.smallrye.reactive.mutiny

Bundle-Developers: cescoffier;email="clement[AT]apache[DOT]org";name="Cl
ement Escoffier",jponge;email="julien[AT]ponge[DOT]org";name="Julien Po
nge"

This was generated from maven metadata...not sure if that's what you want there or not.

This is the groupName.projectName which is the usual for bundle naming in maven land. But maybe you want:

io.smallrye.mutiny instead?

Again, please let me know which if any other jars you would like to be bundles, and I'll add appropriate prs.

@scottslewis
Copy link
Copy Markdown
Contributor Author

Also might want to look at/modify Export-Packages and/or the package versioning.

Copy link
Copy Markdown
Contributor

@cescoffier cescoffier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a question (mostly for @jponge actually)

@jponge
Copy link
Copy Markdown
Member

jponge commented Feb 23, 2026

@scottslewis also note we use https://www.conventionalcommits.org/en/v1.0.0/ to structure commits. Thanks!

@jponge
Copy link
Copy Markdown
Member

jponge commented Feb 23, 2026

Also: does the produced metadata match what the Java module definition?

Our focus is to support Java module definitions, not OSGi which is not part of our stacks.

I'm not against having OSGi meta-data in Mutiny, but it has to be correct, and we'd leave it to the OSGi users community to maintain it in the long run.

@jponge jponge linked an issue Feb 23, 2026 that may be closed by this pull request
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.19%. Comparing base (177be95) to head (aad4fff).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #2075      +/-   ##
============================================
+ Coverage     89.10%   89.19%   +0.09%     
- Complexity     3117     3128      +11     
============================================
  Files           412      412              
  Lines         13296    13296              
  Branches       1687     1687              
============================================
+ Hits          11847    11860      +13     
+ Misses          820      810      -10     
+ Partials        629      626       -3     

see 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scottslewis
Copy link
Copy Markdown
Contributor Author

Also: does the produced metadata match what the Java module definition?

I can't answer this. If Automatic-Module header needs to be removed because it's defined differently elsewhere then I can simply replace it (and will do so if./when requested).

Our focus is to support Java module definitions, not OSGi which is not part of our stacks.

I understand that. I'm a potential consumer of mutiny/commons jars though, and would like them to be able to run on osgi environments without 'wrapping' jars with bundles....as that doesn't work well in the long term.

But as part of this request, I am prepared to maintain the manifest/bundle meta-data as needed.

RE: your comments here:

As a long-time project lead myself I understand what you are saying. However:

I will accept a PR for adding OSGi metadata using a Maven plugin configuration of some sort as long as everything passes (build- and test-wise) and the POM is kept tidy.

As a contributor all I can do is to run the build and test locally from maven pom, and I will do that. I would request that if a CI build break occurs that I can't catch locally, before you remove the OSGi meta-data that you give me or others a chance to fix.

Also, once deployed to maven central, there will be consumers that use this (not just me!). Further, if you want osgi environment test code, I can produce it, but I would have to know more about your CI to do so, as it's a bigger deal than writing a new unit test.

I'm not against having OSGi meta-data in Mutiny, but it has to be correct, and we'd leave it to the OSGi users community to maintain it in the long run.

Yes. RE: correct...of course. I will of course look at the shape of the bundle produced as output during local testing, and assure that it resolves properly in OSGi 8+/Java 17+ environments. It will, however, still be necessary to verify that the jar continues to properly in non-OSGi environments (e.g. Auto Module Name).

@scottslewis
Copy link
Copy Markdown
Contributor Author

Please see pr #2078. The requested changes, and a simplification of the bnd-maven-plugin configuration will be easier to maintain and more reusable (for other parts of mutiny as well dependent libs such as commons).

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.

Provide OSGi meta-data in mutiny jar(s)

3 participants