-
Bug
-
Resolution: Done
-
Major
-
2.1.2.Final, 2.2.4.Final
-
None
In the weld-osgi-bundle manifest, all imports of Guava packages (com.google.common.*) are marked as optional.
This seems to be a left-over of Weld 1.x.
As far as I can see, the dependency is mandatory in Weld's core logic, so the optional directive should be deleted from the manifest.
The impact is more than cosmetic:
Weld 2.2 imports javax.annotation 1.2 whereas Guava does not specify a version for javax.annotation.
Running on Vanilla Equinox 3.9.1 where javax.annotation is exported by the system bundle, you may get a ClassNotFoundException, since Guava gets wired to javax.annotation 0.0 from the system bundle and Weld does not get wired to the optional Guava dependency at all due to a package uses conflict for javax.annotation.
Making the Guava dependency mandatory would either lead to a consistent wiring for Guava, or at least to a resolution error instead of a runtime exception. The user must then fix the resolution problem by manually removing javax.annotation from the list of system packages.