Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347923 - Implement a Mojo for mirroring p2 repositories
Summary: Implement a Mojo for mirroring p2 repositories
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Tobias Oberlies CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 347968
Blocks:
  Show dependency tree
 
Reported: 2011-06-01 08:43 EDT by Matthias Gradl CLA
Modified: 2021-04-28 16:55 EDT (History)
3 users (show)

See Also:


Attachments
patch with proposed changes to open up mirroring service (6.68 KB, patch)
2011-06-01 08:45 EDT, Matthias Gradl CLA
no flags Details | Diff
Test for standalone mirroring (154.97 KB, patch)
2011-06-29 03:24 EDT, Matthias Gradl CLA
t-oberlies: iplog+
Details | Diff
Update tycho-extras to 0.13.0-SNAPSHOT (12.86 KB, patch)
2011-06-29 03:26 EDT, Matthias Gradl CLA
t-oberlies: iplog+
Details | Diff
Add Mojo for mirroring p2 repositories (27.26 KB, patch)
2011-06-29 03:28 EDT, Matthias Gradl CLA
t-oberlies: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Gradl CLA 2011-06-01 08:43:52 EDT
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
Comment 1 Matthias Gradl CLA 2011-06-01 08:45:42 EDT
Created attachment 197087 [details]
patch with proposed changes to open up mirroring service

This is the patch mentioned in the bug description.
Comment 2 Tobias Oberlies CLA 2011-06-01 11:41:48 EDT
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.
Comment 3 Matthias Gradl CLA 2011-06-29 03:24:14 EDT
Created attachment 198789 [details]
Test for standalone mirroring
Comment 4 Matthias Gradl CLA 2011-06-29 03:26:14 EDT
Created attachment 198790 [details]
Update tycho-extras to 0.13.0-SNAPSHOT

to be committed into tycho-extras
Comment 5 Matthias Gradl CLA 2011-06-29 03:28:43 EDT
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)
Comment 6 Tobias Oberlies CLA 2011-07-14 10:49:23 EDT
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