owlcs / owlapi

OWL API main repository
821 stars 315 forks source link

OSGi distribution Guava version range restriction #1084

Closed cmark closed 1 year ago

cmark commented 1 year ago

Is there a reason for restricting Guava to the [18.0.0,22.0.0) version range in the OSGi distribution on the version4 branch? See here: https://github.com/owlcs/owlapi/blob/version4/osgidistribution/pom.xml#L126-L130

The root pom references a more recent Guava, 31.1, see here.

Would it be possible to fix this for an upcoming 4.5.x patch release to allow Guava 31.1 to be used in OSGi context?

ignazio1977 commented 1 year ago

The restriction was in place to match the version Protege uses. Having said that, I haven't checked what version Protege is currently using in a while, so the version might be updated to match, depending. The OSGI distribution should really be renamed the Protege distribution, since it's meant to fit Protege first and foremost. The distribution artifact should be general purpose - does that fit your needs any better?

cmark commented 1 year ago

Hey @ignazio1977,

I see, we are actually forking and modifying both the Protege and the OWL API repositories to allow more recent version of Guava to be used. 27.1.0 was okay with both for a while, but now we need at least 30.1.0. I'll check what needs to be done at the Protege side as well. Thanks for the speedy response. 🤗

ignazio1977 commented 1 year ago

If you're forking both, it might be worth looking at whether Guava is used for any necessary purposes; version 4 still has the dependency but OWLAPI doesn't really need Guava (more recent releases have done away with it altogether). I've kept the dependency in 4 because some interfaces expose Guava classes, so dropping the dependency would break backwards compatibility; but in a fork that wouldn't matter.

gouttegd commented 1 year ago

Actually the [18.0.0,22.0.0) restriction in 4.5.23 is causing problems with Protégé as well.

I believe this is because owlapi-osgidistribution now has the following import declarations in its manifest:

com.google.common.base;version="[18.0,22)"
com.google.common.collect;version="[18.0,22)"
com.google.common.hash;version="[31.1,32)"

(I suppose the last one is a consequence of the fact that the Guava dependency has recently been updated to 31.1-jre.)

Since those three packages are all provided by Guava, there is no way for Protégé (or any other downstream user of the OSGI distribution, AFAICT) to satisfy those conflicting requirements.

The conflict can be fixed by decreasing the lower bound requirement for com.google.common.hash to 18.0 instead of 31.1.

And I think we can also fix @cmark’s problem by raising the upper bound requirement for all com.google.common.* packages to 32 instead of 22. This should not impact Protégé, as long as the lower bound is still 18.0.

ignazio1977 commented 1 year ago

I believe @gouttegd' pull request has fixed this (in release 4.5.24)

cmark commented 1 year ago

Fantastic! Thank you very much! 🙇