OpenNTF / p2-layout-provider

Java web app that serves as a basic proxy to provide a Maven repository front-end to p2 (Eclipse-style) repositories
Apache License 2.0
7 stars 5 forks source link

Support packed Jar files #10

Open jesse-gallagher opened 4 years ago

jesse-gallagher commented 4 years ago

p2 repositories like Eclipse's include versions of the Jar files in .pack.gz format, and it's possible that there could be p2 repositories that have only these files.

This also raises the secondary question of discovery when present - oddly, these bundles seem to show up twice. e.g.:

    <artifact classifier='osgi.bundle' id='org.eclipse.emf.codegen.ecore.xtext' version='1.4.0.v20180706-1146'>
      <processing size='1'>
        <step id='org.eclipse.equinox.p2.processing.Pack200Unpacker' required='true'/>
      </processing>
      <properties size='9'>
        <property name='artifact.size' value='8988'/>
        <property name='download.size' value='8988'/>
        <property name='format' value='packed'/>
        <property name='maven-version' value='1.4.0-SNAPSHOT'/>
        <property name='maven-artifactId' value='org.eclipse.emf.codegen.ecore.xtext'/>
        <property name='maven-extension' value='jar.pack.gz'/>
        <property name='maven-groupId' value='org.eclipse.emf'/>
        <property name='maven-classifier' value='pack200'/>
        <property name='download.md5' value='bbb1d14e60febc44fd4982dfd4bd3e31'/>
      </properties>
    </artifact>

And:

    <artifact classifier='osgi.bundle' id='org.eclipse.emf.codegen.ecore.xtext' version='1.4.0.v20180706-1146'>
      <properties size='10'>
        <property name='artifact.size' value='13975'/>
        <property name='download.size' value='13975'/>
        <property name='download.md5' value='9ce335bad3569aaa73f48aef3dff24dc'/>
        <property name='download.checksum.md5' value='9ce335bad3569aaa73f48aef3dff24dc'/>
        <property name='download.checksum.sha-256' value='da049c8ead3c4be0f299f0eba1b14fef4f2d15a2f8208a4b8827ccf76349add1'/>
        <property name='maven-version' value='1.4.0-SNAPSHOT'/>
        <property name='maven-artifactId' value='org.eclipse.emf.codegen.ecore.xtext'/>
        <property name='maven-extension' value='jar.pack.gz'/>
        <property name='maven-groupId' value='org.eclipse.emf'/>
        <property name='maven-classifier' value='pack200'/>
      </properties>
    </artifact>
jesse-gallagher commented 4 years ago

Based on the size, the former represents the .jar.pack.gz and the latter represents the .jar. I'm not sure how one is supposed to know that the latter is just a .jar, but my best guess is that "true" p2 resolvers know that the <processing/> element indicates the presence of the .pack.gz extension.