Dependency Management in OSGI ServiceMix

Hi, I am new to ServiceMix, so I probably ask the same question that can be answered, but I could not understand.

My doubt is how to control compile time and runtime dependencies when using a package in OSGI ServiceMix. That is, if I create a .jar executable (using unit tests aleast) artifact with maven, where all compilation time dependencies say an example (camel, spring) are processed by pom.xml dependencies and loaded into jar as necessary libs for a successful build. So when I deploy the jar in OSGI, these libs (camel, spring) already exist in javen. Now, being OSGI packages, I support the same packages (camel, spring) here at runtime from the container.

So, I got confused about how or which copy of the required set of dependencies my code chooses to execute. Whether it is inside a .jar or one provided by the OSGI container. Although I know that the MANIFEST file provides options, such as Import Packages , that help import dependencies from other OSGI packages in the container

Maybe I miss some key points of using OSGI here, so please correct me if I am mistaken in any assumptions and provide some pointers / suggestions

thank

+1
source share
1 answer

, maven-bundle-plugin . , .. ,

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-core</artifactId>
    <scope>provided</scope>
</dependency>

, .

0

All Articles