且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么我会收到这个“拆分包"?警告?

更新时间:2023-02-14 21:54:25

Export-Package 的默认值是 {local-packages} 而不是 *

The default value for Export-Package is {local-packages} and not *

使用指令 Export-Package: *,您要求 bnd 导出项目的所有依赖项.

With the directive Export-Package: *, you are asking bnd to export all the dependencies of your project.

删除 * 或使用 {local-packages}

编辑:

请注意,您应该只从 Bundle 导出公共 API.其他一切都应该保密.默认情况下,maven-bundle-plugin 导出所有包,除了包含 implinternal 的包.如果可以,您应该坚持这个约定并省略 Export-Package 指令,或者明确导出您的公共包.

Note that you should only export public API from a Bundle. Everything else should be keep private. By default, maven-bundle-plugin export all packages, except package containing impl or internal. If you can, you should stick with this convention and omit the Export-Package directive, or explicitly export your public packages.