jsr107 / jsr107spec

JSR107 Cache Specification
Apache License 2.0
413 stars 164 forks source link

javax.cache.configuration is not exported in manifest (OSGi issue) #326

Closed exmortal closed 8 years ago

exmortal commented 9 years ago

Hi there.

It seems that cache-api can't be used in OSGi environment since javax.cache.event is not available in export-package. I checked bnd.bnd file and didn't find javax.cache.event package there. Is it a bug or maybe I use cache-api in a wrong way ?

Thanks, Vlad

keilw commented 9 years ago

Actually looking at https://github.com/jsr107/jsr107spec/issues/327 it may be unintended luck, it is not exposing OSGi bundle information in the manifest. Since OSGi would pretty likely interpret the "PFD" postfix as NEWER than the actual 1.0.0 release, too.

exmortal commented 9 years ago

I know that this issue can be defeated via workaround mentioned before, but I believe that this is a bug cause javax.cache.event and javax.cache.configuration are major packages and they should be exported in order to use in a proper OSGi way

Original bnd.bnd file contains only the following: Export-Package: javax.cache;\ javax.cache.annotation;\ javax.cache.event;\ javax.cache.spi;\ Bundle-SymbolicName: javax.cache Bundle-Version: ${project.version}

javax.cache.event and javax.cache.configuration are missing. Simple update to bnd.bnd file can fix issue.

keilw commented 9 years ago

I am absolutely with you. Pivotal won't do this any more, they even dropped Gradle, so every responsible project has to do this. JSR 354 is fully OSGi enabled, so is JSR 363 ;-)

gregrluck commented 8 years ago

Neither Brian nor I use OSGi which is a problem here. We have Felix but of course exposing which package is a programmer call.

Looking at the bnd.bnd I have added all the missing spec packages in. So we now have:

Export-Package: javax.cache;\ javax.cache.annotation;\ javax.cache.configuration;\ javax.cache.event;\ javax.cache.expiry;\ javax.cache.integration;\ javax.cache.management;\ javax.cache.processor;\ javax.cache.spi;\ Bundle-SymbolicName: javax.cache Bundle-Version: ${project.version}

Also updated Felix to 2.3.7.

keilw commented 8 years ago

There is of course a license issue with the API that will likely cause Eclipse to not allow it, but still good to have OSGi working anyway.

gregrluck commented 8 years ago

What issue is that?

Regards

Greg Luck

web: http://gregluck.com http://gregluck.com/ skype: gregrluck yahoo: gregrluck mobile: +61 408 061 622

On 10 Oct 2015, at 1:36 pm, Werner Keil notifications@github.com wrote:

There is of course a license issue with the API that will likely cause Eclipse to not allow it, but still good to have OSGi working anyway.

— Reply to this email directly or view it on GitHub https://github.com/jsr107/jsr107spec/issues/326#issuecomment-147123250.

keilw commented 8 years ago

The Spec License;-)

gregrluck commented 8 years ago

Just looking at OSGi again, I see that we have packageinfo. Those currently say 1.0.

Declares the OSGi version of the package

version 1.0

I guess we should update those as well. Keeping track and incrementing for each change in the package seems tedious. What about:

a) delete packageinfo b) change it to pick up the pom version.

keilw commented 8 years ago

For license issues, see the comment on https://github.com/jsr107/jsr107spec/issues/304.

gregrluck commented 8 years ago

Running some tests, our current config is ignoring the packageinfo files anyway. So going with the strategy of versioning each package to the same as the project. Deleted packageinfo files.

ljacomet commented 8 years ago

Did a quick test with the latest snapshot as part of Ehcache 3 OSGi integration testing, and I can confirm that configuration is now properly exported. Although, let's be honest, the test itself is minimal.