如何配置 Maven 以生成正确命名的 OSGi 包
我正在使用 maven-bundle-plugin 来生成我的包。 困扰我的一个问题是 FinalName(jar 文件)与实际的包名称不符。
在内部,bundle 插件将版本从 Maven 格式转换为 OSGi 格式(例如:1.0-SNAPSHOOT => 1.0.0.SNAPSHOOT)
在构建 jar/bundle 之前应该如何提取实际正确的 OSGi 命名?
举个例子,我的工件将是 com.mycomp.proj,版本为 1.2-SNAPSHOOT 捆绑包符号名称将为com.mycomp.proj。 我想自定义 maven-bundle-plugin 以生成 com.mycomp.proj_1.2.SNAPSHOOT 而不是当前的 om.mycomp.proj-1.2-SNAPSHOOT继承自SuperPOM。
这个想法是提取 OSGIfied 版本并将其放在
I'm using the maven-bundle-plugin to generate my bundles.
One issue that bug me is that the finalName (jar file) does't conform with the actual bundle name.
Internally the bundle plugin convert the version from Maven format to OSGi format (ex: 1.0-SNAPSHOOT => 1.0.0.SNAPSHOOT)
How should the actual propper OSGi naming can be extracted before building the jar/bundle ?
As an example consider that my artefact will be com.mycomp.proj with version 1.2-SNAPSHOOT
The bundle symbolic name will be com.mycomp.proj.
I'll like to customize the maven-bundle-plugin to generate the com.mycomp.proj_1.2.SNAPSHOOT instead of the current one om.mycomp.proj-1.2-SNAPSHOOT that's inherited from SuperPOM.
The idea is to extract the OSGIfied version an put it under <finalName>${project.artifactId}_${osgiVersion}</finalName> .... buh has no clue how/if I can get thhis OSGified version
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
FinalName 仅影响 /target 文件夹中的文件。文件安装或部署到存储库后,始终会重命名为 ${artifactId}-${version}-${classifier}.${type},这是 M2 存储库布局标准的一部分。
The finalName affects the files in the /target folder only. Once the file is installed or deployed to a repository, it is always renamed back to ${artifactId}-${version}-${classifier}.${type} which is part of the M2 repository layout standard.