Community
Participate
Working Groups
Created attachment 203137 [details] stripped down demo project When in maven offline mode (commandline option "--offline"), tycho still tries to download p2.index files from configured p2 repositori(es). See attached demo project. Actually in the case of composite repos like helios, we have one HTTP GET request per child repo, which can introduce a significant lag. E.g. when using the helios p2 repo we have 8 child repos which can sum up to ~4 sec lag (with a typical HTTP roundtrip time of ~0,5 sec from Europe).
The root of the problem is in org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager#loadIndexFile(URI location, IProgressMonitor monitor) which directly uses org.eclipse.equinox.internal.p2.repository.Transport to download the p2.index file (not using org.eclipse.equinox.internal.p2.repository.CacheManager ). At the same time the CacheManager API File createCache(URI repositoryLocation, String prefix, IProgressMonitor monitor) was not designed to cache anything else but a file prefix plus a hardcoded ".xml" or ".jar" suffix so it's currently impossible to use the cache for the p2.index file. Rather than trying to change the whole cache logic in p2 I revert to the pragmatic approach of registering an "OfflineTransport" service implementation with the p2 agent used in tycho. This basically does nothing when in offline mode.
fixed with https://github.com/sonatype/sonatype-tycho/commit/01ba17d82b16c59896319715ddac9c1305604658