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
SLFJ4-579: Export client packages of slf4j-api in version 1 #331
SLFJ4-579: Export client packages of slf4j-api in version 1 #331
Conversation
a3a0e6d
to
b8144dc
Compare
d86f672
to
48f91a9
Compare
@ceki can you please have a look at this after #330? @bjhargrave @timothyjward @stbischof do you want to share your opinion about the second commit (first one is in #330) from an OSGi point of view? |
1e6e936
to
40fd191
Compare
8f3a92e
to
96a3ddd
Compare
Thank you for the work, Hannes! Would be cool if this could be merged and released soon as it solves a lot of dependency issues. |
@HannesWell Regarding compatibility, classes/interfaces that a user can be reasonable expected to use is guaranteed to be backward-binary-compatible. On the other hand, classes/interfaces which are used by logging back-ends implementing the SLF4J API, are not offered this guarantee but the changes are usually have quite a minimal impact. Having said this, at the scale of SLF4J distribution, no change has minimal impact. To answer your question, "org.slf4j" package is for public consumption wheras its sub-packages are considered "internal". |
@HannesWell The jira.qos.ch server crashed and had to be rebuilt from backups. This led to some data loss. If you would like to |
Yes, I understand and agree. The purpose is not to let a logging backend targeted for slf4j-1 be used with the slf4j-2 api artifact. |
@HannesWell What is the goal that we are trying to achieve? If the goal is to ensure backward compatibility for regular clients, then exporting "org.slf4j;version=1.7.36" makes sense. I don't think a logging back-end can be implemented without importing org.slf4j.spi. Moreover, given that there are very few such implementations, at least comparatively, it is reasonable to ask of them to upgrade to slf4j 2.0.x. Thus, I think it would make sense to export org.slf4j.spi, org.slf4j.helpers, org.slf4j.event version 2.0.7 for the sake of logging back-ends. |
Yes, the goal is only to support clients that are programmed against slf4j-1 and only import org.slf4j with range [1.x,2) even with slf4j version two.
Yes. Sorry I think my previous comments were misleading. This change only adds new exports with version 1.7.36. All previously existing exports of packages in version 2.0.7 are not changed so that the slf4j-api module exports the user/client facing packages in version So before this change the Export-Package entry was:
with the current state of the change it is
So the only difference is that the packages
Yes, that makes sense. I'm update to update this PR to only export the package |
Fixes https://jira.qos.ch/browse/SLF4J-576 This allows to use the slf4j-api version 2 artifact as drop-in replacement for slf4j-api version 1 in OSGi environments as well. slf4j-api can now be wired to bundles that require packages of slf4j-api in version 1 or 2. Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
Good. Thank you. You mentioned previously that the PR could optimize for "minimal diff" or for "simplicity of understanding/maintenance". In principle, I think the latter is a better choice. |
96a3ddd
to
5340fc6
Compare
Done.
|
Do you mean regarding the use of the |
@HannesWell Whatever is easier to maintain on the long run. I'll have a look at your earlier commits and attempt to make a more enlightened comment. |
The maven-bundle-plugin uses the bnd-maven-plugin under the hood, consequently the latter receives updates earlier. But I think this should be done in follow up PRs, so that this can land earlier. I can create corresponding small PRs for the migration if you agree. :) |
Since version 2.0.7 the slf4j.api bundle exports the user-api package 'org.slf4j' in version 2.x.y and 1.7.36. This allows to also use libraries, which are programmed against slf4j-1 and import the package 'org.slf4j' with an exclusive upper bound of 2 like '[1.7,2)', with the slf4-api version 2 in OSGi environments. According to SLF4J the client/user facing API is compatible with slf4j-1: - https://www.slf4j.org/faq.html#changesInVersion200 - https://www.slf4j.org/faq.html#compatibility Only the logging-backends/bindings/providers have match the requirements of the specific slf4j version. The corresponding SLF4J issue and change is - https://jira.qos.ch/browse/SLF4J-579 - qos-ch/slf4j#331 Fixes eclipse-platform#588 Fixes eclipse-platform#682
Thanks a lot @ceki for your review, merge and immediate release of slf4j 2.0.7. |
Since version 2.0.7 the slf4j.api bundle exports the user-api package 'org.slf4j' in version 2.x.y and 1.7.36. This allows to also use libraries, which are programmed against slf4j-1 and import the package 'org.slf4j' with an exclusive upper bound of 2 like '[1.7,2)', with the slf4-api version 2 in OSGi environments. According to SLF4J the client/user facing API is compatible with slf4j-1: - https://www.slf4j.org/faq.html#changesInVersion200 - https://www.slf4j.org/faq.html#compatibility Only the logging-backends/bindings/providers have match the requirements of the specific slf4j-api version in use. Since version 2 the slf4j-api uses the ServiceLoader mechanism and requires a 'Service Loader Mediator' implementation in an OSGi runtime. Therefore the Apache Aries SPI Fly Dynamic Weaving Bundle is added with this change. The corresponding SLF4J issue and change is - https://jira.qos.ch/browse/SLF4J-579 - qos-ch/slf4j#331 Fixes eclipse-platform#588 Fixes eclipse-platform#682
Since version 2.0.7 the slf4j.api bundle exports the user-api package 'org.slf4j' in version 2.x.y and 1.7.36. This allows to also use libraries, which are programmed against slf4j-1 and import the package 'org.slf4j' with an exclusive upper bound of 2 like '[1.7,2)', with the slf4-api version 2 in OSGi environments. According to SLF4J the client/user facing API is compatible with slf4j-1: - https://www.slf4j.org/faq.html#changesInVersion200 - https://www.slf4j.org/faq.html#compatibility Only the logging-backends/bindings/providers have match the requirements of the specific slf4j-api version in use. Since version 2 the slf4j-api uses the ServiceLoader mechanism and requires a 'Service Loader Mediator' implementation in an OSGi runtime. Therefore the Apache Aries SPI Fly Dynamic Weaving Bundle is added with this change. The corresponding SLF4J issue and change is - https://jira.qos.ch/browse/SLF4J-579 - qos-ch/slf4j#331 Fixes eclipse-platform#588 Fixes eclipse-platform#682
Since version 2.0.7 the slf4j.api bundle exports the user-api package 'org.slf4j' in version 2.x.y and 1.7.36. This allows to also use libraries, which are programmed against slf4j-1 and import the package 'org.slf4j' with an exclusive upper bound of 2 like '[1.7,2)', with the slf4-api version 2 in OSGi environments. According to SLF4J the client/user facing API is compatible with slf4j-1: - https://www.slf4j.org/faq.html#changesInVersion200 - https://www.slf4j.org/faq.html#compatibility Only the logging-backends/bindings/providers have match the requirements of the specific slf4j-api version in use. Since version 2 the slf4j-api uses the ServiceLoader mechanism and requires a 'Service Loader Mediator' implementation in an OSGi runtime. Therefore the Apache Aries SPI Fly Dynamic Weaving Bundle is added with this change. The corresponding SLF4J issue and change is - https://jira.qos.ch/browse/SLF4J-579 - qos-ch/slf4j#331 Fixes eclipse-platform#588 Fixes eclipse-platform#682
Since version 2.0.7 the slf4j.api bundle exports the user-api package 'org.slf4j' in version 2.x.y and 1.7.36. This allows to also use libraries, which are programmed against slf4j-1 and import the package 'org.slf4j' with an exclusive upper bound of 2 like '[1.7,2)', with the slf4-api version 2 in OSGi environments. According to SLF4J the client/user facing API is compatible with slf4j-1: - https://www.slf4j.org/faq.html#changesInVersion200 - https://www.slf4j.org/faq.html#compatibility Only the logging-backends/bindings/providers have match the requirements of the specific slf4j-api version in use. Since version 2 the slf4j-api uses the ServiceLoader mechanism and requires a 'Service Loader Mediator' implementation in an OSGi runtime. Therefore the Apache Aries SPI Fly Dynamic Weaving Bundle is added with this change. The corresponding SLF4J issue and change is - https://jira.qos.ch/browse/SLF4J-579 - qos-ch/slf4j#331 Fixes eclipse-platform#588 Fixes eclipse-platform#682
Since version 2.0.7 the slf4j.api bundle exports the user-api package 'org.slf4j' in version 2.x.y and 1.7.36. This allows to also use libraries, which are programmed against slf4j-1 and import the package 'org.slf4j' with an exclusive upper bound of 2 like '[1.7,2)', with the slf4-api version 2 in OSGi environments. According to SLF4J the client/user facing API is compatible with slf4j-1: - https://www.slf4j.org/faq.html#changesInVersion200 - https://www.slf4j.org/faq.html#compatibility Only the logging-backends/bindings/providers have match the requirements of the specific slf4j-api version in use. Since version 2 the slf4j-api uses the ServiceLoader mechanism and requires a 'Service Loader Mediator' implementation in an OSGi runtime. Therefore the Apache Aries SPI Fly Dynamic Weaving Bundle is added with this change. The corresponding SLF4J issue and change is - https://jira.qos.ch/browse/SLF4J-579 - qos-ch/slf4j#331 Fixes eclipse-platform#588 Fixes eclipse-platform#682
Since version 2.0.7 the slf4j.api bundle exports the user-api package 'org.slf4j' in version 2.x.y and 1.7.36. This allows to also use libraries, which are programmed against slf4j-1 and import the package 'org.slf4j' with an exclusive upper bound of 2 like '[1.7,2)', with the slf4-api version 2 in OSGi environments. According to SLF4J the client/user facing API is compatible with slf4j-1: - https://www.slf4j.org/faq.html#changesInVersion200 - https://www.slf4j.org/faq.html#compatibility Only the logging-backends/bindings/providers have match the requirements of the specific slf4j-api version in use. Since version 2 the slf4j-api uses the ServiceLoader mechanism and requires a 'Service Loader Mediator' implementation in an OSGi runtime. Therefore the Apache Aries SPI Fly Dynamic Weaving Bundle is added with this change. The corresponding SLF4J issue and change is - https://jira.qos.ch/browse/SLF4J-579 - qos-ch/slf4j#331 Fixes eclipse-platform#588 Fixes eclipse-platform#682
Since version 2.0.7 the slf4j.api bundle exports the user-api package 'org.slf4j' in version 2.x.y and 1.7.36. This allows to also use libraries, which are programmed against slf4j-1 and import the package 'org.slf4j' with an exclusive upper bound of 2 like '[1.7,2)', with the slf4-api version 2 in OSGi environments. According to SLF4J the client/user facing API is compatible with slf4j-1: - https://www.slf4j.org/faq.html#changesInVersion200 - https://www.slf4j.org/faq.html#compatibility Only the logging-backends/bindings/providers have match the requirements of the specific slf4j-api version in use. Since version 2 the slf4j-api uses the ServiceLoader mechanism and requires a 'Service Loader Mediator' implementation in an OSGi runtime. Therefore the Apache Aries SPI Fly Dynamic Weaving Bundle is added with this change. The corresponding SLF4J issue and change is - https://jira.qos.ch/browse/SLF4J-579 - qos-ch/slf4j#331 Fixes eclipse-platform#588 Fixes eclipse-platform#682
Since version 2.0.7 the slf4j.api bundle exports the user-api package 'org.slf4j' in version 2.x.y and 1.7.36. This allows to also use libraries, which are programmed against slf4j-1 and import the package 'org.slf4j' with an exclusive upper bound of 2 like '[1.7,2)', with the slf4-api version 2 in OSGi environments. According to SLF4J the client/user facing API is compatible with slf4j-1: - https://www.slf4j.org/faq.html#changesInVersion200 - https://www.slf4j.org/faq.html#compatibility Only the logging-backends/bindings/providers have match the requirements of the specific slf4j-api version in use. Since version 2 the slf4j-api uses the ServiceLoader mechanism and requires a 'Service Loader Mediator' implementation in an OSGi runtime. Therefore the Apache Aries SPI Fly Dynamic Weaving Bundle is added with this change. The corresponding SLF4J issue and change is - https://jira.qos.ch/browse/SLF4J-579 - qos-ch/slf4j#331 Fixes eclipse-platform#588 Fixes eclipse-platform#682
Since version 2.0.7 the slf4j.api bundle exports the user-api package 'org.slf4j' in version 2.x.y and 1.7.36. This allows to also use libraries, which are programmed against slf4j-1 and import the package 'org.slf4j' with an exclusive upper bound of 2 like '[1.7,2)', with the slf4-api version 2 in OSGi environments. According to SLF4J the client/user facing API is compatible with slf4j-1: - https://www.slf4j.org/faq.html#changesInVersion200 - https://www.slf4j.org/faq.html#compatibility Only the logging-backends/bindings/providers have match the requirements of the specific slf4j-api version in use. Since version 2 the slf4j-api uses the ServiceLoader mechanism and requires a 'Service Loader Mediator' implementation in an OSGi runtime. Therefore the Apache Aries SPI Fly Dynamic Weaving Bundle is added with this change. The corresponding SLF4J issue and change is - https://jira.qos.ch/browse/SLF4J-579 - qos-ch/slf4j#331 Fixes #588 Fixes #682
Fixes https://jira.qos.ch/browse/SLF4J-579
This allows to use the slf4j-api version 2 artifact as drop-in replacement for slf4j-api version 1 in OSGi environments as well.
slf4j-api can now be wired to bundles that require packages of slf4j-api in version 1 or 2.
At the moment the first commit of this PR is actually handled in #330, but since it would otherwise conflict I included that as well. Once #330 is resolved, this only consists of a single, small commit (which is the second one a.t.m.).
@ceki can you please state if besides
org.slf4j
the packagesorg.slf4j.event
andorg.slf4j.helpers
were considered part of the API in slf4j-1? You already told that some classes inorg.slf4j.event
were considered internal, but did that also apply for the package as a whole or where clients supposed to access some classes?