[Enhancement] Introduce MR-Jar?
Search before asking
- [x] I had searched in the issues and found no similar issues.
Enhancement Request
With Shiro needing to maintain compatibility with older versions of Java, I think there is a need to implement Multi-Release JARs. I don't think there is any way around it because we want to use modern JDK features (like virtual threads, scoped values, etc) while maintaining backwards compatibility
Describe the solution you'd like
Use maven plugins to accomplish this.
Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
I tried a small MR-JAR PoC and it was very simple and worked flawlessly, including Jakarta EE. @fpapon Do you know if MR-Jars work with OSGi / Karaf properly? Or maybe @steinarb can shine a light on this?
Ok @lprimak this is the first time I have paid MR-JARs any interest, so I had to google.
Google found me this as the first search hit for "multi release jar osgi" https://blog.osgi.org/2018/02/osgi-r7-highlights-java-9-support.html
Which looks kind of promising: all compliant OSGi versions from and including OSGi v7 should understand and handle MR-JARs
Karaf has been using OSGi 8 since karaf 4.4.0 in April 2022 and OSGi 7 since karaf 4.3.0 in November 2020, so most installations should be good with it.
See also the OSGi v8 spec: https://docs.osgi.org/specification/osgi.core/8.0.0/framework.module.html#framework.module-multireleasejar
But as said, I have no first hand experience with this.