I'm making my first steps in osgi bundle development using maven (maven-bundle-plugin) and apache karaf. My question is: How can i import packages of another bundle?
If I have two bundles A and B. Lets say Bundle A exports a package "package.from.bundle.A". This i can declare in the pom.xml of Bundle A Project:
...
<instructions>
...
<Export-Package>
package.from.bundle.A*;version=${project.version}
</Export-Package>
<Import-Package>
*
</Import-Package>
</instructions>
...
But how can i declare that i want to use that package in Bundle B? If I simply write the packagename between the import-package tag of project B's pom file, this does not work...
...
<instructions>
...
<Export-Package>
</Export-Package>
<Import-Package>
package.from.bundle.A
</Import-Package>
</instructions>
...
How does maven know from to which bundle project this package is related to? How can i use dependencies between my bundles using maven?
thank you