owlcs / owlapi

OWL API main repository
825 stars 314 forks source link

osgi: Do not require SLF4J version 2 or later. #1135

Closed gouttegd closed 4 months ago

gouttegd commented 4 months ago

The client side of the SLF4J API is backwards compatible, so even if the OWLAPI is compiled against slf4j-api version 2.x (currently 2.0.11), it can still be used in a program that provides slf4j-api version 1.x.

But the OSGi distribution of OWLAPI is forcefully requiring slf4j-api version 2.0 at a minimum, because the Apache Felix maven-bundle-plugin is automatically inserting the following instruction in the manifest of the owlapi-osgidistribution archive:

Import-Package: […],org.slf4j;version=[2.0,3),org.slf4j.spi;version="[2.0,3)",[…]

thereby forcing any OSGi application to upgrade to SLF4J 2.x in order to keep using the OWLAPI.

This PR amends the configuration of the maven-bundle-plugin to explicitly insert Import-Package instructions that (1) accept both versions 1.x and 2.x of slf4j-api and (2) do not require the org.slf4j.spi package (which is only needed for SLF4J 2.x).

gouttegd commented 4 months ago

For context, the hard requirement for SLF4J 2.x is causing a major headache in Protégé, see https://github.com/protegeproject/protege/pull/1201.

matentzn commented 4 months ago

@ignazio1977 what do you think? I am very much in favour of this solution as we are holding up too Many dependencies right now because of this problem.. thanks @gouttegd tracking it down!

ignazio1977 commented 4 months ago

Looks good. I'll release 4.5.29 - I imagine you'd need it.

gouttegd commented 4 months ago

That’d be great, yes – sorry for not having tested prior to the 4.5.28 release.

ignazio1977 commented 4 months ago

4.5.29 released

matentzn commented 4 months ago

Awesome, thanks a ton @gouttegd and @ignazio1977!