如何从现有的osgi包创建一个p2仓库? [英] How to create a p2 repository from an existing osgi bundle?
问题描述
我尝试在我的Eclipe-RCP应用程序中使用我的遗留代码。我把所有我的旧的maven项目都带有依赖关系,并使用maven-bundle-plugin创建一个osgi包。
现在我把所有东西都包装在一个新的osgi jar中。
如何从这个osgi jar创建一个与tycho和eclipse目标平台一起使用的p2更新站点?
我试过: https:/ /docs.sonatype.org/display/TYCHO/How+to+make+existing+OSGi+bundles+consumable+by+Tycho
如果我把网络服务器eclipse上生成的文件不会将其识别为软件站点。
如何从现有的osgi软件包中创建一个不使用Eclipse UI的p2软件站点,该进程必须在我的构建服务器的后台运行。
有没有办法使用Maven(Tycho)/ Gradle从现有的自动创建p2更新站点osgi bundle?
我总是使用这两个命令来生成一个p2存储库:
java -jar%ECLIPSE_HOME%\plugins \org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar应用程序org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher -metadataRepository文件:/ C:/ repository -artifactRepository文件:/ C:/ destination -source / C:/ source -configs gtk.linux.x86 -compress -publishArtifacts
其中 c:/ source
存储我的软件包,然后
%ECLIPSE_HOME%/ eclipse - debug -consolelog -nosplash -verbose -application org.eclipse.equinox.p2.publisher.CategoryPublisher -metadataRepository文件:C:/ destination -categoryDefinition文件:C:/source/category.xml
C:/ source
树就是这样
source
- feaures
- 插件
- category.xml
,您需要这个 category.xml
文件将您的软件包分组到类别。这是类别的内容
<?xml version =1.0encoding =UTF-8?>
< site>
< category-def name =alllabel =P2 Repo/>
< iu>
< category name =all/>
< query>< expression type =match> providedCapabilities.exists(p | p.namespace =='osgi.bundle')< / expression>< / query>
< / iu>
< / site>
根据您的eclipse版本,也许您需要更改此文件的版本 org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
i try to use my legacy code in my Eclipe-RCP Application. I took all my old maven projects with dependencies and used the maven-bundle-plugin to create an osgi bundle.
Now i have everything wrapped up in a new osgi jar.
How to create a p2 update site from this osgi jar to use with tycho and the eclipse target platform?
I tried: https://docs.sonatype.org/display/TYCHO/How+to+make+existing+OSGi+bundles+consumable+by+Tycho
If i put the resulting files on a web server eclipse is not recognizing it as "Software Site".
How to create a p2 Software Site from existing osgi bundles without using the Eclipse UI, the process has to run in background on my build-server.
Is there a way to use Maven (Tycho)/ Gradle to automatically create a p2 update site from an existing osgi bundle?
I always use these two commands to generate a p2 repository:
java -jar %ECLIPSE_HOME%\plugins\org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher -metadataRepository file:/C:/repository -artifactRepository file:/C:/destination -source /C:/source -configs gtk.linux.x86 -compress -publishArtifacts
where c:/source
are stored my bundles, and then
%ECLIPSE_HOME%/eclipse -debug -consolelog -nosplash -verbose -application org.eclipse.equinox.p2.publisher.CategoryPublisher -metadataRepository file:C:/destination -categoryDefinition file:C:/source/category.xml
the C:/source
tree is like this
source
-- feaures
-- plugins
-- category.xml
and you'll need this category.xml
file to group your bundles into categories. This is the category's content
<?xml version="1.0" encoding="UTF-8"?>
<site>
<category-def name="all" label="P2 Repo"/>
<iu>
<category name="all"/>
<query><expression type="match">providedCapabilities.exists(p | p.namespace == 'osgi.bundle')</expression></query>
</iu>
</site>
depending on your eclipse version, maybe you'll need to change the version of this file org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
这篇关于如何从现有的osgi包创建一个p2仓库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!