Skip to content

Commit 1418273

Browse files
HannesWellceki
authored andcommitted
Fix LOGBACK-1729: Add OSGi S.L.M. entries to load logback Configurators
Add and improve the OSGi Service Loader Mediator entries to load logback Configurators provided by other bundles. Additionally add entry to provide the ServletContainerInitializer service implementation in OSGi runtimes via SPI. In general improve the overall quality of the Service Loader Mediator entries. See - https://docs.osgi.org/specification/osgi.cmpn/8.0.0/service.loader.html - https://aries.apache.org/documentation/modules/spi-fly.html#specconf Fixes https://jira.qos.ch/browse/LOGBACK-1729 Signed-off-by: Hannes Wellmann <[email protected]>
1 parent 52cf6cd commit 1418273

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

logback-classic/pom.xml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,17 @@
329329
*
330330
</Import-Package>
331331
<!-- Needed to integrate ServiceLoader mechanism with OSGi -->
332-
<Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
333-
<Provide-Capability>osgi.serviceloader;osgi.serviceloader=org.slf4j.spi.SLF4JServiceProvider</Provide-Capability>
334-
335-
332+
<Require-Capability><![CDATA[
333+
osgi.extender;filter:="(&(osgi.extender=osgi.serviceloader.processor)(version>=1.0.0)(!(version>=2.0.0)))",
334+
osgi.extender;filter:="(&(osgi.extender=osgi.serviceloader.registrar)(version>=1.0.0)(!(version>=2.0.0)))",
335+
osgi.serviceloader;filter:="(osgi.serviceloader=ch.qos.logback.classic.spi.Configurator)";osgi.serviceloader="ch.qos.logback.classic.spi.Configurator";cardinality:=multiple
336+
]]></Require-Capability>
337+
<Provide-Capability><![CDATA[
338+
osgi.service;objectClass:List<String>="jakarta.servlet.ServletContainerInitializer";effective:=active,
339+
osgi.service;objectClass:List<String>="org.slf4j.spi.SLF4JServiceProvider";effective:=active,
340+
osgi.serviceloader;osgi.serviceloader="jakarta.servlet.ServletContainerInitializer";register:="ch.qos.logback.classic.servlet.LogbackServletContainerInitializer",
341+
osgi.serviceloader;osgi.serviceloader="org.slf4j.spi.SLF4JServiceProvider";register:="ch.qos.logback.classic.spi.LogbackServiceProvider"
342+
]]></Provide-Capability>
336343
</instructions>
337344
</configuration>
338345
</plugin>

0 commit comments

Comments
 (0)