如何从现有的 osgi 包创建 p2 存储库?

uti*_*vel 6 eclipse p2 eclipse-rcp tycho maven

我尝试在我的 Eclipe-RCP 应用程序中使用我的旧代码。我使用了所有带有依赖项的旧 maven 项目,并使用 maven-bundle-plugin 创建了一个 osgi 包。

现在我把所有东西都装在一个新的 osgi jar 中。

如何从此 osgi jar 创建 p2 更新站点以与 tycho 和 eclipse 目标平台一起使用?

我试过:https : //docs.sonatype.org/display/TYCHO/How+to+make+existing+OSGi+bundles+consumable+by+Tycho

如果我将生成的文件放在 Web 服务器上,eclipse 不会将其识别为“软件站点”。

如何在不使用 Eclipse UI 的情况下从现有的 osgi 包创建 p2 软件站点,该过程必须在我的构建服务器的后台运行。

有没有办法使用 Maven (Tycho)/Gradle 从现有的 osgi 包自动创建 p2 更新站点?

Lui*_* E. 5

我总是使用这两个命令来生成 p2 存储库:

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
Run Code Online (Sandbox Code Playgroud)

c:/source我的包裹存放在哪里,然后

%ECLIPSE_HOME%/eclipse -debug -consolelog -nosplash -verbose -application org.eclipse.equinox.p2.publisher.CategoryPublisher -metadataRepository file:C:/destination -categoryDefinition file:C:/source/category.xml
Run Code Online (Sandbox Code Playgroud)

C:/source树是这个样子

source
 -- feaures
 -- plugins
 -- category.xml
Run Code Online (Sandbox Code Playgroud)

并且您将需要此category.xml文件来将您的捆绑包分组。这是该类别的内容

<?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>
Run Code Online (Sandbox Code Playgroud)

根据您的 eclipse 版本,也许您需要更改此文件的版本 org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar