If you put the findbugs annotations on the system classpath when launching the 
tests then they will be exposed through the system bundle alongside the 
annotations from the JRE using the javax.annotation package.

Regards,

Tim

> On 26 Oct 2017, at 18:50, JT <karaf-u...@avionicengineers.com> wrote:
> 
> Hi
> 
> I am in the process of OSGi-ifying the source for TestFx, a JavaFx test 
> framework. This bundle will import package javax.annotation  provided by 
> google.findbugs.annotation bundle but this is the JSR305 javax.annotation 
> package not the same as exported by the Felix system bundle 0.
> 
> TestFx-Core will also import packages from Google Guava which itself will 
> import javax.annotation but again this should be the JSR 305 javax.annotation 
> package. Guava specifies this package as optional and also does not specify 
> version to import, thus it can end up importing the package from Felix system 
> bundle and I can then get an error when resolving TestFx as it is exposed to 
> two different versions of javax.annotation.
> 
> It looks as though JSR305 isn't an extension of version 1 as 305 doesn't 
> appear to include the classes from version 1. In other words to me it doesn't 
> look OSGi compatible.
> 
> I can fix this issue by installing and resolving the findbugs.annotation 
> bundle before guava, but as I need to run TestFx in automated tests I need a 
> way to ensure findbugs.annotations is resolved before Guava is. Is there any 
> way I can do this or any other way around this issue?
> 
> Thanks
> 
> Kerry

Reply via email to