Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-dev] How to access cached bundles?

Sorry for the late reply. See my answers inline.

> -----Original Message-----
> From: tycho-dev-bounces@xxxxxxxxxxx [mailto:tycho-dev-
> bounces@xxxxxxxxxxx] On Behalf Of Mickael Istria
> Sent: Mittwoch, 3. September 2014 18:32
> To: tycho-dev@xxxxxxxxxxx
> Subject: Re: [tycho-dev] How to access cached bundles?
> 
> Up!
> To be more explicit: I have an IU (id + version) and I want to access it
> from local cache if available.

Tycho has two local caches:
- It caches the indices (content.xml/artifacts.xml) of remote p2 repositories (see RemoteRepositoryCacheManager). If you want to benefit from this cache, you need to get the RemoteAgent (which is an IProvisioningAgent) and simply load the repositories in the normal p2 way.
- It caches artifacts downloaded from remote p2 repositories. To benefit from this cache, you need to wrap the artifact repositories you want to access in an MirroringArtifactProvider. The latter will then serve artifacts from the cache if available, or download and store new artifacts. See TargetPlatformFactoryImpl.createJointArtifactProvider for an example.

> I currently use "mirrorService.mirrorStandalone". Is enabling local cache
> something I can configure in the RepositoryReference parameter?
No.

> Is there
> a way to get URIs of internal (cached) metadata/artifact repositories? If
> so, it could simply be a matter of adding the local repo to the
> RepositoryReferences.
The cached repositories don't have their own URLs because caching happens transparently. You access the repository URL with its original URL, and if it has already been loaded in the current mvn call, or if the build is offline, the cached version will be returned (by the IMetadataRepositoryManager from the RemoteAgent).

Regards
Tobias

> 
> Cheers,
> --
> Mickael Istria
> Eclipse developer at JBoss, by Red Hat
> My blog - My Tweets


Back to the top