Kul*_*ain 24
按照文章从标准jar创建Eclipse插件(OSGi包)来实现这一目标.虽然这种方法不使用Bnd,但你可以实现你想要的.
总之,您可以执行以下操作:
通过选择创建一个新的插件项目 File-> New -> Project...-> Plug-in Development -> "Plug-in from Existing JAR Archives"
在这个新插件(包)中选择您想要的罐子.输入其他插件数据(名称,版本,ID等).
Unzip the JAR archive into the project.然后按完成.取消选中该复选框Unzip the JAR archive into the project,可防止从Jar中提取通常不必要的类文件.
编辑:
导出捆绑包以将其安装到OSGi运行时.选择您的包并选择File -> Export -> Plug-in Development -> "Deployable plug-ins and fragment".
取消选中导出来源复选框.
Pet*_*ens 10
-classpath: jar/htmlcleaner-2.2.jar, jar/htmlcleaner-2.2-src.zip
Export-Package: org.htmlcleaner.*;version=1.0
Import-Package: org.apache.tools.ant;resolution:=optional,\
org.jdom;resolution:=optional,\
*
Bundle-Version: 2.2.1
保存此文件后,查看生成的目录,瞧,有你的捆绑!您可以为要包装的任意数量的包重用相同的项目.
然后,您可以将捆绑包发布到其中一个存储库.选择bnd.bnd文件,然后使用上下文菜单选择Release Bundle.
编辑:NB 您不能直接使用来自其他项目的'wrap'项目,因为Eclipse需要源树才能工作.有两种解决方法:
https://github.com/bndtools/bndtools/wiki/How-to-Wrap-Bundles
| 归档时间: |
|
| 查看次数: |
21546 次 |
| 最近记录: |