SeB.Fr
SeB.Fr

Reputation: 1344

p2 repository only with feature content and no dependencies

I need to create p2 repositories to add extra software in my application. for instance I want to externalize all i18n bundle, so I have a set of features with only i18n fragments.

The way I do that is from a complete p2 repository that was build by pde and containt the product and the i18n plugins and features.

I try to use the p2.mirror ant task to create a p2 repository with only the i18n fragments but the problem is that it always embbed the host bundles that those i18n bundle depend on. This makes my p2 repo huge because it has most of my application along with the 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>

Is there a way to create a p2 repository including only the bundle that are referenced in a given feature and not the ones that host them ?

Upvotes: 0

Views: 317

Answers (1)

oberlies
oberlies

Reputation: 11723

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.

Upvotes: 1

Related Questions