Community
Participate
Working Groups
Build Identifier: We have the situation that we want to consume some features from projects that only provide legacy update sites instead of "nice" p2 repositories. Currently we have a solution in place that starts some Ant scripts from a Maven build. Knowing that Tycho actually has a mirroring service in place, we'd like to leverage this functionality and create a Mojo that does this and get rid of all that Ant. We have a basic implementation of a mirroring mojo, but there are enhancements in the Tycho core required to allow the functionality: - if there are no rootUnits specified, the mirror service should mirror all IUs, currently a NPE is preventing this. - if there are no environments specified, the mirror service shall anyway execute and just ignore platform specific IUs. - the used RepositoryReferences object needs to accept plain URIs to be able to point it to repositories (i.e. update sites) out there. Example call: mirrorService.mirror(sources, destination, null /* all IUs*/, context /* without environments */, flags, "mirrored repository"); I'll attach a patch that introduces the changes to Tycho, actually the environment stuff was part of Tycho at some point in time (https://github.com/sonatype/sonatype-tycho/commit/e58364edac98787da56b5df192628849da47ba98#diff-58 lines 56-), I've just re-added this part (including the TODOs there) We also plan to bring the mirroring mojo into tycho-extras once it is open again for new features with 0.13.0-SNAPSHOT, like done for the p2 publisher mojo. Reproducible: Always
Created attachment 197087 [details] patch with proposed changes to open up mirroring service This is the patch mentioned in the bug description.
I think a mirroring Mojo (in tycho-extras) would be great. I think I get the idea of how the patch allows you to develop such a Mojo. However I think you meant to include all environment-specific fragments rather than excluding them all. I have reworked the patch so that mirroring all IUs (including fragments) should be possible, and committed that change for you to check. I'm saying "should", because this is currently hard to test. Also, this won't get much better when you contribute the mirror Mojo to tycho-extras. Therefore I would like to ask you to write a bundle test for the MirrorApplicationServiceImpl covering your use cases.
Created attachment 198789 [details] Test for standalone mirroring
Created attachment 198790 [details] Update tycho-extras to 0.13.0-SNAPSHOT to be committed into tycho-extras
Created attachment 198791 [details] Add Mojo for mirroring p2 repositories for tycho-extras Requires integrated patch 198789 in Tycho 0.13.0-SNAPSHOT (and 198790 in tycho-extras obviously)
The new goal is documented in the wiki [1] and advertised in the release notes [2]. [1] http://wiki.eclipse.org/Tycho/Additional_Tools [2] http://wiki.eclipse.org/Tycho/Release_Notes/0.13