| Summary: | honour settings <mirror/> configurations | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Igor Fedorenko <igor> |
| Component: | Tycho | Assignee: | Tobias Oberlies <t-oberlies> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | beat, benjamin.schwertfeger, mike, mn, pascal, t-oberlies |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | 376981 | ||
| Bug Blocks: | |||
|
Description
Igor Fedorenko
Sorry, we broke this when introducing the new TargetDefinitionResolver. The problem was that the logic wasn't isolated but weaved with the resolution logic. To do this properly, Tycho would need its own implementation of MetadataRepositoryManager and ArtifactRepositoryManager which honour the mirror configuration settings. With this in place, the settings could be honoured anywhere, and it would no longer necessary to repeat the mirror logic wherever repositories are loaded. IIRC the *RepositoryManagers don't have an "id" argument, so we probably need to use URIs to look up the mirrors. IMHO this should be okay. Otherwise, we could extend the p2 interface by this parameter. If you provide a quality patch, I would be willing to include it into p2 :-) Postponing to 0.14.0 +1... it would be nice to have this... Actually this appears to work? As per http://www.iulidragos.org/?p=207, using something like works just fine - I just tried it and it appears to work: <mirror> <id>p2</id> <name>...</name> <url>http://p2.company.com/dependencies/7.0</url> <mirrorOf>*</mirrorOf> <mirrorOfLayouts>p2</mirrorOfLayouts> </mirror> As long as I enter the repository explicit in the pom.xml, it is possible to set a mirror in the settings.xml which works at most. If I add http://reserve.itemis.de/eclipse/releases/indigo as an explicit repository instead of .target with selected Features, I have to increase the heap space. Using the asterisk for mirrorOf and only .target definition without repositories inside the pom.xml, does not work. I looked at TCP/IP connections and got none to my mirror and many to eclipse.org in this case. The mirror seems to have no effect for children of a composite, because http://download.eclipse.org/technology/epp/packages/indigo/ is set as an absolute URL in http://download.eclipse.org/releases/indigo/compositeContent.jar. Even if I enter this site as a repository and mirror it, the original repository is retrieved. Did I mention we welcome quality patches? ;-) The foundation for implementing this consistently has (finally) been laid with the introduction of a dedicated p2 agent for all remote operations. In this agent, it should be easily possible to intercept all repository loading calls, and redirect them according to the mirrors setting. This also automatically covers children of composite repositories. And in case someone really considers contributing a patch: the right place to pass parameters from the Maven settings.xml to Tycho's OSGi runtime is the MavenContextImpl instance. This should now [1] work for all repositories with explicitly configured IDs, i.e. both repositories with layout p2 in the POM and target files with (non-standard) id attributes (see [2] for an example). I'll still need to check what happens if no ID is specified (which should be the most common case for target files because maintaining an ID is not really convenient). Related to bug 377086. [1] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=34e1a8165876829ac2d8fe4548b4a660fea85467 [2] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-its/projects/target.httpAuthentication/platform.target This change [1] completes this feature: Whenever there is no explicitly configured ID, mirrors for p2 repositories are looked up in the settings.xml using the URL (without trailing slashes) as ID. [1] https://git.eclipse.org/r/6289 Added documentation for <mirror> configuration: http://wiki.eclipse.org/Tycho/Target_Platform/Authorization_and_Mirrors Change merged to master [1] [1] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=f374a7797df6c5b70e038ad76e7c4624f66d6560 |