如何将 category.xml 中的两个不同功能与 Tycho Maven 中的配置文件一起使用?

How to use two different features in category.xml with profiles in Tycho Maven?

目前,我有两个包含不同 category.xml 文件的项目。 category.xml 两个文件都声明了一个单独的功能:

project1/category.xml:

<?xml version="1.0" encoding="UTF-8"?>
<site>
   <feature url="features/myfeature.feature_1.6.0.qualifier.jar" id="myfeature.feature" version="1.6.0.qualifier">
      <category name="mycategory"/>
   </feature>
   <category-def name="mycategory" label="Category"/>
</site>

project2/category.xml:

<?xml version="1.0" encoding="UTF-8"?>
<site>
   <feature url="features/myfeature.advanced.feature_1.6.0.qualifier.jar" id="myfeature.advanced.feature" version="1.6.0.qualifier">
      <category name="mycategory"/>
   </feature>
   <category-def name="mycategory" label="Category"/>
</site>

现在,我想将 project1project2 合并到一个项目中。我可以用两个单独的配置文件声明这两个功能吗?然后,我可以 运行 我的 Maven 构建 maven -P profile1 <goal>.

一个 category.xml 文件可以引用许多不同的功能 - 事实上,p2 存储库仅包含 category.xml 文件中提到的内容。

因此,根据您想要实现的目标,您可以 (a) 在您的存储库项目中有一个引用这两个功能的 category.xml 文件,或者 (b) 有两个存储库项目,然后合并他们,例如声明一个 composite update site or (c) merging them using the tycho p2 mirror tool.