ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ernest Pasour <Ernest.Pas...@sas.com>
Subject Re: retrieving the modules and organizations via the API
Date Tue, 08 Apr 2008 11:55:21 GMT
Xavier, thanks for your answer.
Sorry, my example wasn't complete.  I *am* configuring my ivy instance.
When I call ivy.listOrganisationEntries(), I get back 3 items.
1. <company name> - this is a local resolver
2. <company name> - this is an url resolver
3. Tools - this is an url resolver.
Calling ivy.listModules(<company name organisation entry>) gives me all the modules
on my repo chain.  However, it surprised me that some of the modules (third party modules)
have the org listed as <company name>.  What I was expecting was for third party jars
to come back with an org of "TPJ", which is what I would need to put in the ivy.xml file to
successfully resolve the module.
So my questions become:
1. How do I take the ModuleEntry objects I get back and determine what the actual  organisation
for those objects should be? (for purposes of resolve).  I could take each bundle, pull down
the ivy.xml for it, and parse the <info> tag, but I'd rather not have to.
2. Is there an easy way to alter/reconstruct a ModuleEntry object with the correct organisation?
 If I determine that a module is actually the TPJ organisation, then I want to alter my module
entry to reflect that so that my clients will be seeing the expected data.  I'm caching the
module list for performance.
Thanks,
Ernest
Xavier Hanin
Tue, 08 Apr 2008 00:55:42 -0700
On Mon, Apr 7, 2008 at 9:05 PM, Ernest Pasour <[EMAIL PROTECTED]> wrote:

> I'm using 2.0B1
>
> I'm trying to use an Ivy object to determine the modules in my current ivy
> repo chain.  So I do something like the following:
>
>
> Ivy ivy = Ivy.newInstance();
> OrganisationEntry[] orgEntries=ivy.listOrganisationEntries();
> for (int i=0;i<orgEntries.length;i++)
> {
>        ModuleEntry[] modules=ivy.listModules(orgEntries[i]);
> }
>
> However, the list of OrganisationEntry objects I get back does not match
> the organizations that are expected in the ivy.xml file:
> <dependency name="JavaMail" rev="1.4.0" org="TPJ" conf="runtime,compile"/>
>
> In this case, I don't get back any "TPJ" organization at all.  I *do* get
> all the modules back, but with duplicates and some with bogus organizations.
>
> Also, if I use the Ivy api to do a resolve on a ModuleRevisionId
> constructed from the module name and [bogus] organization, it fails.
>
> So, my questions are:
> 1. is this a bug?
> 2. is there a way for me to query the organizations/modules that will let
> me feed them back into the ivy.xml file/resolve call correctly.
> 3. I still need to be able to query each module for the available
> revisions, which seems to work correctly at the moment, despite the
> conflicting data.


According to your code you don't seem to be calling configure on your Ivy
instance. It's very important for Ivy to work properly to be configured with
your settings. If it still fails, maybe it's because you don't have an
organization token in your pattern. In this case Ivy has no way to know the
organizations without actually parsing all metadata files in your repo,
which is possible only with the RepositoryManagementEngine, which as you can
expect doesn't perform very well.

Xavier

>
>
>
> Thanks,
> Ernest
>
>



Mime
View raw message