java - OSGi Bundle status is not Active (CQ5 Maven Project) WHY? -


i know when status of bundle in cq installed, there dependencies , why bundle cannot "active".

i using jersey client v 2.17 in cq5 service, need jersey core client jar. added dependency in /bundle/pom.xml. bundle compiles , deploys but never turns active

i added jersey client jar in felix console manually, doing bundle got activated jersey client jar not active keep getting classnotfounderror there transitive dependencies in jersey client jar well.

i tried following:

  1. manually tried resolving dependencies adding jars in felix console. failed. loop never ends(transitive dependencies)
  2. i tried tweaking changing manifest of jersey core client jar, added dynamicimport-package: *. tricks osgi conatainer, @ runtime find jars. has worked me in past needs classes aren't present.(both jars jersey client , bundle become active class not found error classes not there no matter how try fool osgi conatainer)failed.
  3. so tried thing, added dependent jars in /bundle/pom.xml. using maven thought solve issue bundle still installed not active

my third step miserable failure. maven when installing jars manually in felix console anyways ?!!

what should ?

first of all, maven helps build-time dependencies, , maven dependencies @ jar level. when installing bundles osgi container, have deal run-time dependencies, @ package level.

so there mismatch between build-time , run-time, dependencies work differently. argue maven not match @ all, why @ least people lot of osgi applications have switched bnd/bndtools , command-line gradle build.

back problem. running missing dependencies @ runtime. bundle importing packages not exported bundle. fix that, can use 1 of 2 strategies:

  1. you can embed dependencies need inside bundle. here you'd need embed jersey client (and transitively dependencies needs). not expose of other bundles, code end in bundle.
  2. you can install dependencies need bundles. means need transitively find packages need run jersey client. there tools available that. maven not 1 of them.

hope helps. might not hoping hear.