Combine/aggregate eclipse p2 repositories / extendable p2 repository

守給你的承諾、 提交于 2019-11-28 19:45:12

What you are looking for is a composite p2 repository. You'll just need the following two files in the base folder:

  • A compositeContent.xml with the following content:

    <?xml version='1.0' encoding='UTF-8'?>
    <?compositeMetadataRepository version='1.0.0'?>
    <repository name='Project XYZ Releases Repository' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
        <properties size='1'>
            <property name='p2.atomic.composite.loading' value='true'/>
        </properties>
        <children size='3'>
            <child location='VersionFolder1'/>
            <child location='VersionFolder2'/>
            <child location='VersionFolder3'/>
        </children>
    </repository>
    
  • A compositeArtifacts.xml with the following, similar content:

    <?xml version='1.0' encoding='UTF-8'?>
    <?compositeArtifactRepository version='1.0.0'?>
    <repository name='Project XYZ Releases Repository' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
        <properties size='0'>
        </properties>
        <children size='3'>
            <child location='VersionFolder1'/>
            <child location='VersionFolder2'/>
            <child location='VersionFolder3'/>
        </children>
    </repository>
    

When a new version is released, just add the new folder as child in both files.

The two files may also be compressed as ZIP and named compositeContent.jar and compositeArtifacts.jar to save network bandwidth. However this makes editing the files a little less practical.

The Eclipse simultaneous release repositories also use this approach. E.g., at the time of writing this, the Eclipse Luna repository contains only the original release and SR 1 (see compositeContent, compositeArtifacts). SR 2 will be added later, so that users will be able to get updates without having to configure a new repository URL.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!