Search code examples
eclipse-rcpp2

Eclipse p2 mirror keeping sources


I am looking for a way to do a mirror of a p2 repository - reduce it to the needed content and still keep the sources attached. So far I have been trying to use the ant task to mirror the repository:

<target name="R2020-09-partial" description="Reduced 2020-09 update site only containing feratures and plugins directly or indirectly references by the update site">
    <p2.mirror>
        <repository location="${destinationFolder}${ant.project.invoked-targets}" />
        <source>
            <repository location="${destinationFolder}/R2020-09" />
        </source>
        <slicingOptions followStrict="false" />
        <iu id="org.eclipse.platform.feature.group" />
        <iu id="org.eclipse.rcp.feature.group" />
        [...]
        <iu id="org.eclipse.help.feature.group" />
    </p2.mirror>
</target>

this is working fine and a mirror is created, but there are only very few of the original sources still part of the mirror. Somehow it is not none or all but only some.

How do I make it that the p2.mirror will copy all sources of the jars it takes?

I have been reading this https://rtist.hcldoc.com/help/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fp2_repositorytasks.htm but I have not been able to find the clue I was looking for.

Thank you all Nico

PS. for clarification the destinationFolder contains a R2020-09 mirror without any slicing. This is where I see the sources as well. They seem to get lost in the slicing step.


Solution

  • For the three mentioned feature install units, there are corresponding source install units:

    <iu id="org.eclipse.platform.feature.group" />
    <iu id="org.eclipse.platform.source.feature.group" />
    
    <iu id="org.eclipse.rcp.feature.group" />
    <iu id="org.eclipse.rcp.source.feature.group" />
    
    [...]
    
    <iu id="org.eclipse.help.feature.group" />
    <iu id="org.eclipse.help.source.feature.group" />
    

    Instead of Ant, you might consider to use Maven with Tycho's tycho-p2-extras:mirror (see here for an example).