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 <[email protected]>
  • Loading branch information
HannesWell authored and ceki committed Mar 17, 2023
1 parent 2235d3c commit b363bb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
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
5 changes: 5 additions & 0 deletions slf4j-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
<configuration>
<instructions>
<Import-Package>org.slf4j.spi;version="${range;[===,+);${version;===;${maven_version;${project.version}}}}"</Import-Package>
<!-- Export the client/user package of slf4j-api version 1 to make the slf4j-api bundle in version 2 usable for bundles that only import slf4j-1.x -->
<_exportcontents><![CDATA[
*,\
org.slf4j;uses:="org.slf4j.event,org.slf4j.helpers,org.slf4j.spi";version="${latest.1.version}"
]]></_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 b363bb3

Please sign in to comment.