您的位置:首页 > Web前端

如何把一个包含features和plugins的folder 变成一个Maven Tycho支持的 P2仓库?

2016-03-25 22:50 676 查看
今天笔者在用Maven Tycho 编译Plugin的时候,由于用到自己定义的OSGI的依赖,但是这个目录的依赖,只有 features和Plugins夹,没有Content.xml和artifact 文件,那么,如何把一个包含features和plugins的folder 变成一个Maven Tycho支持的 P2仓库?

其实命令很简单,但是却很难被找到和发现,那就是,

java -jar <targetProductFolder>/plugins/org.eclipse.equinox.launcher_*.jar
-application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher
-metadataRepository file:/<some location>/repository
-artifactRepository file:/<some location>/repository
-source /<location with a plugin and feature directory>
-configs gtk.linux.x86
-compress
-publishArtifacts


如果读者在window系统上面,就可以移除-configs gtk.linux.x86

-compress 参数的意思,就是生成的artifact 和content文件是否要压缩成zip(jar)的格式

artifactRepository 和 metadataRepository,就是生成的artifact 和content文件存放的目录,我们需要把其指定成一个目录。

在笔者电脑上的测试的时候,命令如下,

java -jar D:\cicd\eclipse-mars\plugins\org.eclipse.equinox.launch
er_1.3.100.v20150511-1540.jar  -application org.eclipse.equinox.p2.publisher.Fea
turesAndBundlesPublisher -metadataRepository file:///d:/cicd/localcustomreposito
ry -artifactRepository file:///d:/cicd/localcustomrepository -source C:/originalpluginsfolder
-compress -publishArtifacts


执行前的目录originalpluginsfolder的结构



执行后的localcustomreposito结构为,

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Eclipse P2 Maven Tycho