Skip to content

Commit

Permalink
SLF4J-579: Export client packages of slf4j-api in version 1
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
HannesWell committed Mar 15, 2023
1 parent 2235d3c commit 96a3ddd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pom.xml
Expand Up @@ -34,9 +34,8 @@

<properties>
<!-- yyyy-MM-dd'T'HH:mm:ss'Z' -->
<project.build.outputTimestamp>2022-12-12T19:19:39Z</project.build.outputTimestamp>
<latest.stable.version>1.7.36</latest.stable.version>
<latest.2.version>2.0.0-alpha7</latest.2.version>
<project.build.outputTimestamp>2022-12-12T19:19:39Z</project.build.outputTimestamp>
<latest.1.version>1.7.36</latest.1.version>
<!-- java.util.ServiceLoader requires Java 6 -->
<jdk.version>8</jdk.version>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
Expand Down
7 changes: 7 additions & 0 deletions slf4j-api/pom.xml
Expand Up @@ -59,6 +59,13 @@
<configuration>
<instructions>
<Import-Package>org.slf4j.spi;version="${range;[===,+);${version;===;${maven_version;${project.version}}}}"</Import-Package>
<!-- Export client packages of slf4j-api version 1 to make slf4j-api 2 usable for bundles that only import slf4j-2 -->
<_exportcontents><![CDATA[
*,\
org.slf4j;version="${latest.1.version}";uses:="org.slf4j.event,org.slf4j.helpers,org.slf4j.spi",\
org.slf4j.event;version="${latest.1.version}";uses:="org.slf4j,org.slf4j.helpers",\
org.slf4j.helpers;version="${latest.1.version}";uses:="org.slf4j,org.slf4j.event,org.slf4j.spi"
]]></_exportcontents>
<Require-Capability><![CDATA[
osgi.extender;filter:="(&(osgi.extender=osgi.serviceloader.processor)(version>=1.0.0)(!(version>=2.0.0)))",
osgi.serviceloader;filter:="(osgi.serviceloader=org.slf4j.spi.SLF4JServiceProvider)";osgi.serviceloader="org.slf4j.spi.SLF4JServiceProvider"
Expand Down

0 comments on commit 96a3ddd

Please sign in to comment.