When I run mvn clean install
, maven throws the following exception:
Exporting packages that are not on the Bundle-Classpath[Jar:dot]
I could build successfully a few days ago, why is it happenning?
When I run mvn clean install
, maven throws the following exception:
Exporting packages that are not on the Bundle-Classpath[Jar:dot]
I could build successfully a few days ago, why is it happenning?
It's hard to be certain without details of your POM configuration, but it looks like you're using a bnd based plugin, which probably means the maven-bundle-plugin
or the bnd-maven-plugin
.
In either case the bundle that's being produced is exporting a package which is not in the bundle. This is a sure-fire way to break your application, and so bnd is failing the bundle creation.
At a guess (because I don't have much information to go on) one of the following has happened:
.
. Fixing the first three issues is easy, either fix the package name, re-add the right dependency, or remove the export. The last two are also fairly easy to fix. You can change your bundle classpath like this:
Bundle-ClassPath: /path/to/my.jar, /path/to/another.jar, /path/to/folder
Another, probably better, option is not to include the code in a nested JAR file, but instead to embed the code directly in your bundle. This would mean adjusting your plugin configuration to use embedding syntax. As I don't know what plugin you're using I can't give you an example, but the documentation for bnd's include resource is here