[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ivy-user
Subject:    Re: Advice for managing large-scale OSGI repository for data analysis
From:       Nicolas_Lalevée <nicolas.lalevee () hibnet ! org>
Date:       2011-09-04 19:49:37
Message-ID: E8C4A5B4-2F78-449B-8DD1-17DC6393AB68 () hibnet ! org
[Download RAW message or body]

You main sample didn't through the mailing list, but I wrote some tests as part of \
Ivy get it working.

> two minor fixes:
> 
> org.apache.ivy.osgi.p2.P2MetadataParser.UnitHandler.handleAttributes(Attributes):
> 
> boolean singleton = Boolean.getBoolean(atts.getValue(SINGLETON)); 
> --> changed to 
> boolean singleton = Boolean.parseBoolean(atts.getValue(SINGLETON));
> 
> Despite that this information is not used, calling Boolean.getBoolean seems to be \
> wrong.

nice catch. fixed.

> in org.apache.ivy.osgi.updatesite.UpdateSiteResolver.init()
> 
> loader.load(u);
> --> changed to:
> RepoDescriptor repoDescriptor = loader.load(u);
> setRepoDescriptor(repoDescriptor);
> 
> otherwise, repoDescriptor gets never initialized.

I did fix that too while making the tests I just wrote pass.

> However, I couldn't make downloading and installing work due to other problems. I \
> tried to follow your advice to iterate over all organisations and from there over \
> all modules. This is the resulting code: 
> String resolverName = url.toExternalForm();
> UpdateSiteResolver resolver = new UpdateSiteResolver();
> resolver.setName(resolverName);
> resolver.setUrl(url.toExternalForm());
> for (final OrganisationEntry organisation : resolver.listOrganisations()) {
> for (final ModuleEntry entry : resolver.listModules(organisation)) {
> System.out.println(entry);
> }
> }
> 
> resolver.listOganizations returns an empty list (which is not that amazing since \
> there is no organization attribute).

I fixed that too.
It will now always return an organization with an name as an empty String.

> thus, I tried to use the RepoDescriptor directly :
> 
> RepoDescriptor repo = opt.get();
> for (final ModuleDescriptor module : (Set<ModuleDescriptor>)
> repo.getModules()) {
> ModuleRevisionId moduleRevisionId =
> module.getModuleRevisionId();
> ivy.install(moduleRevisionId, resolverName, "local-disk", new InstallOptions()
> setTransitive(true).setValidate(true).setOverwrite(true));
> }
> }
> 
> This approach fails because Ivy cannot download the Artifacts because there is no \
> URL associated with the artifact. Any ideas?

yeah, there was a lot of mess about figuring out the location of the artifacts. The \
current trunk will behave more nicely.

Nicolas


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic