How to avoid "The package is not exported by the bundle dependencies" error in IntelliJ IDEA?

TheFooProgrammer picture TheFooProgrammer · Aug 13, 2014 · Viewed 11.8k times · Source

I have created a new Maven project using the CQ5 archetype and imported it into IntelliJ IDEA. IntelliJ marks usages of some classes such as org.apache.felix.annotations.Component, org.apache.felix.annotations.Reference, etc. IntellIJ as erroneous with the following error message:

The package is not exported by the bundle dependencies

IntelliJ OSGi Error Message

  1. Is this a legitimate error?
  2. How can I fix it (as opposed to disabling the inspection)?

Answer

hippoLogic picture hippoLogic · Oct 13, 2014

I'm using version 12.1.4

  1. The error seems legit. I'm not able to find that package in the ACQ 5.6.1 Doc.

  2. I turn off the inspection by:

    • Right-clicking on the block in the right margin.
    • Click "Customize Highlighting level".
    • Bring the slider down to "None".