[slf4j-dev] [JIRA] Updates for SLF4J-574: slf4j OSGi metadata missing "uses" clauses

QOS.CH (JIRA) noreply-jira at qos.ch
Fri Dec 9 20:06:00 CET 2022


SLF4J / SLF4J-574 [Open]
slf4j OSGi metadata missing "uses" clauses

==============================

Here's what changed in this issue in the last few minutes.

There is 1 comment.

View or comment on issue using this link
https://jira.qos.ch/browse/SLF4J-574

==============================
 1 comment
------------------------------

Jonah Graham on 09/Dec/22 7:52 PM
This is running in Eclipse, I don't really have a reduced test case. We (the Eclipse project collectively) are hitting the problem because we are trying to update to use SLF4J being [consumed directly from Maven central.|https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/588] Up until now we repackaged SLF4J to add the missing Uses clauses using this [bnd file|https://git.eclipse.org/r/plugins/gitiles/orbit/orbit-recipes/+/refs/heads/master/logging/org.slf4j.api_1.7.30/osgi.bnd].

The problem is only exposed when there are multiple versions of SLF4J installed in the OSGi environment, without the uses clauses the OSGi wiring can cross-wire them.

I don't know how to provide a reproducible test case, but I do know what needs to be changed in the manifests.

The Export-Package in our rebuilt version looks like this for 1.7.30:

Export-Package: org.slf4j;version="1.7.30";uses:="org.slf4j.spi",
org.slf4j.event;version="1.7.30";uses:="org.slf4j,org.slf4j.helpers",
org.slf4j.helpers;version="1.7.30";uses:="org.slf4j,org.slf4j.event,org.slf4j.spi",
org.slf4j.spi;version="1.7.30";uses:="org.slf4j"

 

And in the 1.7.30 on [maven central|https://central.sonatype.dev/artifact/org.slf4j/slf4j-api/1.7.30] it looks like this:

Export-Package: org.slf4j;version=1.7.30,
org.slf4j.spi;version=1.7.30,
org.slf4j.helpers;version=1.7.30,
org.slf4j.event;version=1.7.30

 

We haven't rebuilt the 2.x version (as we are hoping to stop doing that), but the 2.05 version looks basically the same:

Export-Package: org.slf4j;version=2.0.5, org.slf4j.spi;version=2.0.5, org.slf4j.helpers;version=2.0.5, org.slf4j.event;version=2.0.5

 

I have provided a first stab at a fix in https://github.com/qos-ch/slf4j/pull/324


==============================
 This message was sent by Atlassian Jira (v8.8.0#808000-sha1:e2c7e59)



More information about the slf4j-dev mailing list