Skip to content
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

Update the Eclipse SDK TP's slf4j-api to 2.0.7 and remove 1.7 version #981

Merged
merged 1 commit into from
May 15, 2023

Conversation

HannesWell
Copy link
Member

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:

Only the logging-backends/bindings/providers have match the requirements of the specific slf4j version.

The corresponding SLF4J issue and change is

Fixes #588
Fixes #682

@HannesWell
Copy link
Member Author

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.

I'll also experiment with the Aries SPI Fly Dynamic Weaving Framework Extension, which is a fragment to the system bundle and therefore hopefully does not need to be activated 'manually' through a corresponding Product configuration. If that does not work as expected I think the auto-start defaults of PDE's product editor should be adjusted to include that bundle too (if present).

@HannesWell
Copy link
Member Author

HannesWell commented Mar 17, 2023

Hmm. Almost. Looks like sshd-osgi imports slf4j packages that are not considered as user packages...
Will look into https://github.com/apache/mina-sshd

Looking again at @merks' analysis in #588 (comment) that should be the only trouble maker left in the SimRel. All other either only import org.slf4j (which is now exported in version 1.7.x and 2.0x) or have their version ranges already widened.

Let's hope we get a quick fix in sshd.

@HannesWell
Copy link
Member Author

HannesWell commented Mar 18, 2023

Hmm. Almost. Looks like sshd-osgi imports slf4j packages that are not considered as user packages...
Will look into https://github.com/apache/mina-sshd

Created a PR at MINA-SSHD to address it. Lets hope it is merged and released quickly:

@HannesWell
Copy link
Member Author

Hmm. Almost. Looks like sshd-osgi imports slf4j packages that are not considered as user packages...
Will look into https://github.com/apache/mina-sshd

Created a PR at MINA-SSHD to address it. Lets hope it is merged and released quickly:

* https://github.com/apache/mina-sshd/pull/336

Good news. The PR is merged, so now we only have to wait for a release of the new version.

@HannesWell
Copy link
Member Author

Hmm. Almost. Looks like sshd-osgi imports slf4j packages that are not considered as user packages...
Will look into https://github.com/apache/mina-sshd

Created a PR at MINA-SSHD to address it. Lets hope it is merged and released quickly:

* https://github.com/apache/mina-sshd/pull/336

Good news. The PR is merged, so now we only have to wait for a release of the new version.

Great. With a (self-assembeled) snapshot of mina-sshd 2.10.0 the platform-aggregator build finally succeeds.
So it looks like mina-sshd 2.10.0 is really the only missing piece. Let's hope the release in time for the next release 🤞🏽

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
@HannesWell
Copy link
Member Author

With #1066 being merged, this is finally ready 😃🎉

@HannesWell HannesWell marked this pull request as ready for review May 15, 2023 18:08
@HannesWell HannesWell added the noteworthy Noteworthy feature label May 15, 2023
@HannesWell HannesWell added this to the 4.28 M3 milestone May 15, 2023
@HannesWell HannesWell merged commit 178309f into eclipse-platform:master May 15, 2023
@HannesWell HannesWell deleted the slf4j_2.0.7 branch May 15, 2023 18:38
@mickaelistria
Copy link
Contributor

Thanks and congrats for this tedious improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
noteworthy Noteworthy feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

slf4j missing uses constraints Migrate to SLF4J-2 from Maven-Central
2 participants