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
Are you exporting those packages as part of the bundle definition? In the maven project, you should have the maven bundle plugin with <Export-Package>your.packages.here</Export-Package>
defined. Are these packages included in that definition? If not, those services won't actually be availale in OSGi.
In my case, I accidentally "configured OSGi" when I only wanted to configure Spring. The way I dealt with this issue was by right clicking the right margin at one of the affected lines, clicking "Customize Highlighting Level" --> "Configure Inspections". I think hippoLogic's solution will get rid of all your syntax-level error highlighting as well as helpful inspection-level highlighting. This way you can simply tune the latter to exclude OSGi.
It'd be even better to de-configure OSGi (which I haven't investigated), but here's a quick/dirty fix to reduce the highlighting noise.
I'm using version 12.1.4
The error seems legit. I'm not able to find that package in the ACQ 5.6.1 Doc.
I turn off the inspection by:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With