-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Use BND for both OSGI and JPMS #1819
Conversation
0b33b7b
to
1b142e3
Compare
Using BND we still need to manually overwrite the detected (or undetected) module name of multi-release dependency JARs. Theoretically this was fixed in bndtools/bnd#5327, but I can't get it to work. The module name of MRJs with a module descriptor in their @HannesWell, do you know what am I missing? |
The following packages are no longer exported: * org.apache.logging.log4j.core.layout.internal * org.apache.logging.log4j.core.message * org.apache.logging.log4j.core.time.internal * org.apache.logging.log4j.core.tools.picocli * org.apache.logging.log4j.core.util.internal A new JPMS module is generated, which sets the following Java modules as optional: * java.compiler, * java.logging, * java.naming, * java.sql.
Differences in the module descriptor: * `java.management` is added to the optional requires. Differences in the OSGi descriptor: * the import statement on `sun.reflect` disappears, * an import statement on `org.apache.logging.log4j.internal` appears.
Apparently the BND (partial) fix is only in the |
Closes #1830. |
JARs without either an `Automatic-Module-Name` header nor a module descriptor MUST be optional.
Instead of providing a parameter to `mvnw`, we always activate Java 8 tests on the CI.
Sorry for the late and after the fact reply. I just checked the following slf4j bundles in more detail and everything looks good and worked well in my testing in our two OSGi applications, from which one uses
I noted that for some bundles the symbolic name changed e.g. from If you want to keep the MANIFEST.MF a little bit cleaner you could remove the Thank you @ppkarwasz for this work! |
That is great news, so I believe we have a green light to release 2.21.0, unless you have an idea what is going on in #1741. Regarding the bundle names, we chose to prefer consistency (use bundle names that can be module names) over backward compatibility. If you can think of a place where bundle names are used (build scripts?), we can revert them to the original form. Now we are just waiting for INFRA-25032. |
From my point of view yes 🚀🙂
That's a reasonable choice. I'm know cases that depend on the bundle-name, for example if another Bundle requires a log4j bundle using OSGi's Require-Bundle (but that's discouraged/deprecated and as far as I know mainly used in the Eclipse world only. And since you provide good OSGi metadata, i.e. versioned packages, there is no reason to not used Import-Package instead, which only depends on the package name). Or if the bundles are part of an Eclipse Feature (which is basically a group of Bundles that form a 'feature' of an Eclipse Product like the IDE), but there names can be changed too and usually a feature once build is pinned to a specific version of the Bundle so there is no compatibility problem. |
This PR is a work in progress and replaces #1815.
It replaces maven-bundle-plugin with bnd-maven-plugin, which:
The introduction of JPMS support in BND allows us:
Class.forName
calls are supported by BND).To help in the review process, BND configurations for various modules will have their own PRs and this one will be complete when modifications to all modules will be accepted:
log4j-1.2-api
(Add BND configuration tolog4j-1.2-api
#1825),log4j-api
(Add BND configuration forlog4j-api
#1820),log4j-api-test
(Add BND configuration to Core dependents #1828),log4j-appserver
(Add BND configuration to bridges #1827),log4j-cassandra
(Add BND configuration to Core dependents #1828),log4j-core
(Add BND configuration forlog4j-core
#1821),log4j-core-test
(Add BND configuration to Core dependents #1828),log4j-couchdb
(Add BND configuration to Core dependents #1828),log4j-docker
(Add BND configuration to Core dependents #1828),log4j-flume-ng
(Add BND configuration to Core dependents #1828),log4j-iostreams
(Add BND configuration to bridges #1827),log4j-jcl
(Add BND configuration to bridges #1827),log4j-jdbc-dbcp2
(Add BND configuration to Core dependents #1828),log4j-jpa
(Add BND configuration to Core dependents #1828),log4j-jpl
(Add BND configuration to bridges #1827),log4j-jul
(Add BND configuration to bridges #1827),log4j-kubernetes
(Add BND configuration to Core dependents #1828),log4j-layout-template-json
(Add BND configuration to Core dependents #1828),logj4-layout-template-json-test
(Add BND configuration to Core dependents #1828),log4j-mongodb3
(Add BND configuration to Core dependents #1828),log4j-mongodb4
(Add BND configuration to Core dependents #1828),log4j-slf4j2-impl
(Add BND configuration to bridges #1827),logj4-slf4j-impl
(Add BND configuration to bridges #1827),logj4-spring-boot
(Add BND configuration to Core dependents #1828),logj4-spring-cloud-config-client
(Add BND configuration to Core dependents #1828),log4j-taglib
(Add BND configuration to Core dependents #1828),logj4-to-jul
(Add BND configuration to bridges #1827),logj4-to-slf4j
(Add BND configuration to bridges #1827),logj4-web
(Add BND configuration to Core dependents #1828).