문제

With the p2 ant tasks, it's pretty simple to mirror the plugins for a feature.

But how do I mirror everything necessary to install a feature?

도움이 되었습니까?

해결책

Couldn't get p2.mirror working; the task either mirrors too much (like all versions of a feature even if you're only interested in the last or a specific one) and/or too little (like just the feature but none of the dependencies).

My solution was like this:

  1. Unpack Eclipse to eclipse-template
  2. Create a copy as eclipse-install
  3. Install the feature in eclipse-install
  4. Delete any file in the copy which exists in the version from step #1 (cd eclipse-template ; find . -type f -exec rm "../eclipse-install/{}").

That leaves you with the feature and plugin files. Use org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher to turn that into a p2 repo (see the docs for details).

[UPDATE 2011-11-01] There is another solution if you don't need to run this from the command line.

  1. Create a "Target Definition" in an Eclipse project (create a new one or use an existing one, doesn't matter)
  2. Add update sites to this *.target file
  3. Select the features you want
  4. Click on the tiny "Export" button in the top right corner of the Target Definition Editor (next to "Set as Target Platform")

That will export all the selected features with the exact version that you selected plus all dependencies in a folder of your choice.

The target editor is a bit clumsy and slow but it works.

Keep the file under version control because the target editor sometimes messes up.

다른 팁

I am using the following Ant code to mirror 2 features in a single repository:

<!-- Creates single p2 repo from 2 repos -->
<p2.mirror>
    <repository location="file:///${DESTINATION}/repo-name" append="false"/>
    <source>
       <repository location="file:///${feature1-repo}/feature1"/>
       <repository location="file:///${feature2-repo}/feature2"/>
    </source>
</p2.mirror>

Moreover you can use the <iu> and the feature's id to specify the feature to be mirrored. Features id must be specified in the following way:

your.feature.id.group.group.group 

If you have specific plateform configurations for your feature, then the IU becomes

your.feature.id.win32.win32.x86 (OS, Widget system, Architecture)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top