2 Replies Latest reply on Mar 5, 2013 10:23 PM by Li Wang

    confusion about dependency declaration and OSGi import - export wire up

    Li Wang Newbie

      I just hope someone can help me clear my understanding about dependency declaration and OSGi import - export wire up.

       

      Now suppose I have two bundles bar and foo created by Maven. bar denpends on foo . In bar's pom.xml:

       

       

      In bar's manifest:

      import package: foo.Foo

       

      When I issue cmd: mvn install. Maven will search for foo in .m2 repository. Then load foo.Foo with classloader and compile it.

       

      Scenario 1:

      Now I want to deploy bundle bar to OSGi container. Suppose I only deployed bar. Then I start bundle bar. It does not work, because I have not deployed bar's dependency foo into OSGi container. Here my understanding is each dependency must also be deployed to OSGi for dependency resolution.

       

      Scenario 2:

      Now I uninstall bundle foo, but install another bundle sub. sub has the same package foo.Foo. But bar's pom.xml remains the same. OSGi wire up bundles based on matching import and export packages. In this case, will OSGi wire up bar and sub, even if bar's pom.xml still depends on foo ? If OSGi wire up bar and sub, how does OSGi interact with bundle's pom.xml ?

       

      Edited by: wl880504 on Mar 6, 2013 2:29 AM

       

      Edited by: wl880504 on Mar 6, 2013 2:31 AM