0

我需要创建 p2 存储库以在我的应用程序中添加额外的软件。例如,我想外部化所有 i18n 包,所以我有一组只有 i18n 片段的功能。

我这样做的方式是来自一个完整的 p2 存储库,该存储库由 pde 构建并包含产品和 i18n 插件和功能。

我尝试使用 p2.mirror ant 任务创建一个仅包含 i18n 片段的 p2 存储库,但问题是它总是嵌入那些 i18n 包所依赖的主机包。这使我的 p2 存储库变得巨大,因为它包含我的大部分应用程序以及 i18n。

<p2.mirror source="file://${build.repo.path}" destination="file://${i18n.repo.path}">
    <iu id="org.talend.i18n.all-feature.feature.group" version="" />
</p2.mirror>

有没有办法创建一个 p2 存储库,只包括给定特性中引用的包,而不是托管它们的包?

4

1 回答 1

1

You need to add so-called "slicing options" and specify that you only want strict version range dependencies:

<p2.mirror ...>
    <slicingoptions followStrict="true" />
</p2.mirror>

The inclusion relationship between features and plug-ins is encoded in p2 as strict version range dependency, so with this option you should only get the feature and its included plug-ins.

Note that p2 relies on the publishers to correctly translate the information from the feature.xml. If you use a non-standard publisher or influence the publishing via a p2.inf, the strict version range dependencies may not correspons 1:1 to the inclusions. In this case, it is not possible to achieve what you want. p2 mirroring will only operate on p2 metadata – there is no option to make it look at the feature.xml again.

于 2013-04-29T08:29:08.973 回答