Pedro, I'm using maven-bundle-plugin too. At the beginning I had the same kind of problems you are facing because Bnd (the library behind MBP) automatically includes every import that it finds searching the dependency chain. Sometimes it is necessary and you just can't run away from this. but sometimes it is not.
Part one of the solution that I'm using was to narrow the imports that bnd calculates. I just run MBP one time to be able to extract from the generated manifest what I really need and then set the <Import-Package> tag manually. see an example here: https://github.com/jbehave/jbehave-osgi/blob/master/jbehave-osgi-bundles/org.jbehave.osgi.core/pom.xml#L188 Part two was to create an R5 OSGi Repository containing all those dependencies and install Felix BundleRepository in the container instance that will handle the install of those dependencies. regards, Cristiano 2014-10-24 12:43 GMT-02:00 PedroD <[email protected]>: > Greetings, > I’m using Felix Framework for my OSGi project, but I’ve came across a > severe problem concerning third party dependencies. > > > I’m using eclipse and maven-bundle-plugin to generate my bundles from the > sources and the MANIFEST.MF from the POM.XML file. So far so good. however > when I have some third party dependency in my bundle, I find myself looking > for an infinite list of JARs, which usually are not bundles, and putting > them in my /bundle Felix directory until no more dependencies are missing. > > I call this process “Downloading the Internet for my OSGi application to > work”. > > What am I doing wrong? Sure I must be doing something very wrong, because > I can’t imagine anyone having a bundle A that depends on B, which then > depends on C and D, and then those two will depend on several others and so > on… to go look for ALL those dependencies manually using google or maven > central! That's insane! > > What is the correct way to automate this? I would love to have one of the > two solutions: > > 1) Be able to create a massive JAR file with all of its dependencies > embedded, but exporting only the packages I want, and, of corse, not > importing any package. > > 2) (My preferred solution) Having a way to get all my dependencies into > individual JAR files that I can simply paste into the /bundle directory. > > 3) (Even more preferred) Having a way to use third party JARs without > downloading 8GB of dependencies to my project. > > I have found tools that do me this, *but just for direct (1st degree) > dependencies*, leaving transitive dependencies for me to solve manually. > > This problem is critical. The lack of such a tool hampers the usage of > OSGi. I’ve searched and searched and searched, I’ve came across all the 101 > solutions such as PAX, bndtools, and friends, but it seems that they *do > not* solve this issue… > > Please help me. *Please provide a living example if you can, people like > me around the world will benefit from the solution to this problem.* > > Thanks! > > > _______________________________________________ > OSGi Developer Mail List > [email protected] > https://mail.osgi.org/mailman/listinfo/osgi-dev > -- "Tudo vale a pena se a alma não é pequena..."
_______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
