ju xiaomi
ju xiaomi

Reputation: 53

How to refer some classes of a bundle in a non-osgi environment?

I have made some jars in a bundle. For example: a.jar, b.jar, a.jar has class named some.pkg.SomeClass. I writed MANIFEST.MF file like below:

Bundle-ClassPath: lib/a.jar,
 lib/b.jar
Export-Package:some.pkg

I export the jar with name ab.jar,and it worked in an osgi environment.But in a non-osgi environment, when I refer this class some.pkg.SomeClass, it failed!

So how can I refer this class some.pkg.SomeClass in a same jar not only in an osgi environment but also in a non-osgi environment?

Upvotes: 0

Views: 76

Answers (1)

Christian Schneider
Christian Schneider

Reputation: 19606

If you package jars inside the ab.jar then it is not possible to access these outside of OSGi.

An alternative is to use the maven shade plugin to extract the classes from both jars and package the classes in the ab.jar.

Upvotes: 2

Related Questions