更新时间:2022-10-14 23:35:04
如果没有POM配置的详细信息,很难确定,但看起来像使用了一个bnd这可能意味着 maven-bundle-plugin
或者 bnd-maven-plugin
。
在猜测(因为我没有太多的信息去on)发生以下情况之一:
。
。 修正前三个问题很简单,可以修复程序包名称,重新添加正确的依赖关系,或者删除导出。最后两个也很容易解决。你可以像下面这样改变你的bundle classpath:
$ b $ pre $ Bundle-ClassPath:/path/to/my.jar,/ path / to /another.jar,/ path / to / folder
另一个可能更好的选项是不包括嵌套的JAR文件中的代码,而是直接在您的包中嵌入代码。这将意味着调整您的插件配置使用嵌入语法。因为我不知道你使用的是什么插件,所以我不能给你一个例子,但是bnd的include资源的文档是这里
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