Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1711

com.google.common package imports should not be optional

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.1.2.Final, 2.2.4.Final
    • Fix Version/s: 2.2.5.Final
    • Component/s: OSGi support
    • Labels:
      None

      Description

      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jharting Jozef Hartinger
                Reporter:
                hwellmann.de Harald Wellmann
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: